mirror of
https://github.com/evgen-app/chess_rpg_backend.git
synced 2024-11-10 19:57:12 +03:00
fixed no auth header error
This commit is contained in:
parent
80a63fe252
commit
acc37f8e82
|
@ -6,8 +6,8 @@ from .services.jwt import read_jwt
|
|||
|
||||
class PlayerAuthentication(authentication.BaseAuthentication):
|
||||
def authenticate(self, request):
|
||||
token = request.headers["Authorization"]
|
||||
if not token:
|
||||
|
||||
if "Authorization" not in request.headers or not (token := request.headers["Authorization"]):
|
||||
raise exceptions.AuthenticationFailed("No credentials provided.")
|
||||
|
||||
t = read_jwt(token)
|
||||
|
|
Loading…
Reference in New Issue
Block a user