[jwtMiddleware] on expired signature error, returns Nobody and do not raise an exception
This commit is contained in:
parent
e5c25ede1f
commit
262de901a8
|
@ -102,6 +102,8 @@ class JWTAuthenticationBackend(AuthenticationBackend):
|
|||
raise AuthenticationError(
|
||||
'Trying to connect using *DEBUG* token in *PRODUCTION* mode')
|
||||
|
||||
except jwt.ExpiredSignatureError as exc:
|
||||
return AuthCredentials(), Nobody()
|
||||
except jwt.InvalidTokenError as exc:
|
||||
raise AuthenticationError(str(exc)) from exc
|
||||
except Exception as exc:
|
||||
|
|
Loading…
Reference in New Issue