mirror of
https://github.com/evgen-app/chess_rpg_backend.git
synced 2024-11-25 19:14:02 +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):
|
class PlayerAuthentication(authentication.BaseAuthentication):
|
||||||
def authenticate(self, request):
|
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.")
|
raise exceptions.AuthenticationFailed("No credentials provided.")
|
||||||
|
|
||||||
t = read_jwt(token)
|
t = read_jwt(token)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user