changed the exception name AuthenticationError instead of AuthorizationError since this method we are authenticating, not authorizing
parent
4cada6d99a
commit
eb2c392f01
|
@ -5,7 +5,7 @@ import jwt
|
|||
_log = getLogger(__package__)
|
||||
|
||||
|
||||
class AuthorizationError(Exception):
|
||||
class AuthenticationError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
|
@ -23,10 +23,10 @@ def decode_auth_token(auth_token: str, secret_key: str) -> tuple:
|
|||
except jwt.ExpiredSignatureError:
|
||||
error_msg = 'Selene token expired'
|
||||
_log.info(error_msg)
|
||||
raise AuthorizationError(error_msg)
|
||||
raise AuthenticationError(error_msg)
|
||||
except jwt.InvalidTokenError:
|
||||
error_msg = 'Invalid Selene token'
|
||||
_log.info(error_msg)
|
||||
raise AuthorizationError(error_msg)
|
||||
raise AuthenticationError(error_msg)
|
||||
|
||||
return user_uuid
|
||||
|
|
Loading…
Reference in New Issue