register user, sign in and sign out working

This commit is contained in:
knst-kotov
2021-06-29 13:26:46 +03:00
parent 2dac73b412
commit c9b3d3a833
14 changed files with 81 additions and 30 deletions

View File

@@ -56,9 +56,8 @@ class JWTAuthenticate(AuthenticationBackend):
if JWT_AUTH_HEADER not in request.headers:
return AuthCredentials(scopes=[]), AuthUser(user_id=None)
auth = request.headers[JWT_AUTH_HEADER]
token = request.headers[JWT_AUTH_HEADER]
try:
scheme, token = auth.split()
payload = await _Authenticate.verify(token)
except Exception as exc:
return AuthCredentials(scopes=[], error_message=str(exc)), AuthUser(user_id=None)