We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 930c66c commit 6649042Copy full SHA for 6649042
api/src/authentication/authentication.py
@@ -7,7 +7,7 @@
7
from authentication.models import User
8
from common.exceptions import UnauthorizedException
9
from common.logger import logger
10
-from config import config
+from config import config, default_user
11
12
oauth2_scheme = OAuth2AuthorizationCodeBearer(
13
authorizationUrl=config.OAUTH_AUTH_ENDPOINT,
@@ -29,6 +29,8 @@ def get_JWK_client() -> jwt.PyJWKClient:
29
30
31
def auth_with_jwt(jwt_token: str = Security(oauth2_scheme)) -> User:
32
+ if not config.AUTH_ENABLED:
33
+ return default_user
34
if not jwt_token:
35
raise UnauthorizedException
36
key = get_JWK_client().get_signing_key_from_jwt(jwt_token).key
0 commit comments