Browse Source

Fix returned exception for invalid token

merge-requests/1/head
Drew Short 7 years ago
parent
commit
013130e064
  1. 2
      server/atheneum/middleware/authentication_middleware.py

2
server/atheneum/middleware/authentication_middleware.py

@ -146,7 +146,7 @@ def require_token_auth(func: Callable) -> Callable:
request.headers.get('Authorization', None)) request.headers.get('Authorization', None))
if token and authenticate_with_token(token.username, token.password): if token and authenticate_with_token(token.username, token.password):
return func(*args, **kwargs) return func(*args, **kwargs)
return authentication_failed('Bearer')
return authentication_failed('Token')
return decorate return decorate

Loading…
Cancel
Save