Skip to content

Commit

Permalink
style: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ndxmrb committed Aug 19, 2024
1 parent c97e342 commit 84c7214
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fastapi_azure_auth/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations

from fastapi import HTTPException, WebSocketException, status
from starlette.requests import HTTPConnection

Expand All @@ -10,7 +11,7 @@ class InvalidAuthHttp(HTTPException):

def __init__(self, detail: str) -> None:
super().__init__(
status_code=status.HTTP_401_UNAUTHORIZED, detail=detail, headers={'WWW-Authenticate': 'Bearer'}
status_code=status.HTTP_401_UNAUTHORIZED, detail=detail, headers={"WWW-Authenticate": "Bearer"}
)


Expand All @@ -30,6 +31,6 @@ def InvalidAuth(detail: str, request: HTTPConnection) -> InvalidAuthHttp | Inval
"""
Returns the correct exception based on the connection type
"""
if request.scope['type'] == 'http':
if request.scope["type"] == "http":
return InvalidAuthHttp(detail)
return InvalidAuthWebSocket(detail)

0 comments on commit 84c7214

Please sign in to comment.