token-type-tolerance

This commit is contained in:
2023-10-13 14:47:31 +03:00
parent e9f68c8fb1
commit 7cd5929df2
2 changed files with 2 additions and 4 deletions

View File

@@ -29,8 +29,7 @@ class JWTAuthenticate(AuthenticationBackend):
user_id=None, username=""
)
if token.startswith("Bearer"):
token = token[len("Bearer "):]
token = token.split(" ")[-1]
if len(token.split(".")) > 1:
payload = await SessionToken.verify(token)