some-fixes-chats

This commit is contained in:
2022-11-23 12:57:58 +03:00
parent 5ecb0d811b
commit 2cb152bdb1
7 changed files with 36 additions and 16 deletions

View File

@@ -28,6 +28,7 @@ class SessionToken:
token is of specified type
"""
try:
print('[auth.authenticate] session token verify')
payload = JWTCodec.decode(token)
except ExpiredSignatureError:
payload = JWTCodec.decode(token, verify_exp=False)
@@ -58,6 +59,8 @@ class JWTAuthenticate(AuthenticationBackend):
try:
payload = await SessionToken.verify(token)
except Exception as exc:
print("[auth.authenticate] session token verify error")
print(exc)
return AuthCredentials(scopes=[], error_message=str(exc)), AuthUser(
user_id=None
)