New features

This commit is contained in:
Ivan Nikolskiy 2025-08-14 12:36:10 +01:00
parent a75d135589
commit 0ba9d2c775

View File

@ -27,12 +27,14 @@ class HopIDAuthentication(BaseAuthentication):
try:
claims = verify_jwt_token(access_token)
user = get_user_from_jwt_claims(claims, access_token)
except Exception:
except Exception as e:
print(e)
user = None
# Try refreshing session-based tokens
if not user and is_session_based and refresh_token:
tokens = refresh_access_token(refresh_token)
print(tokens)
if tokens:
access_token = tokens.get('access_token')
refresh_token = tokens.get('refresh_token')
@ -43,7 +45,8 @@ class HopIDAuthentication(BaseAuthentication):
try:
claims = verify_jwt_token(access_token)
user = get_user_from_jwt_claims(claims, access_token)
except Exception:
except Exception as e:
print(e)
user = None
if not user: