Fixes: 1) Correct HTTP header key to use "HTTP_X_EVIBES_AUTH" for token-based authentication.

This commit is contained in:
Egor Pavlovich Gorbunov 2025-11-12 12:56:15 +03:00
parent 9632915593
commit 6d8d4def5b

View file

@ -36,7 +36,7 @@ class JWTAuthMiddleware(BaseMiddleware):
class _Req: class _Req:
def __init__(self, token_str: str): def __init__(self, token_str: str):
self.META = {"HTTP_AUTHORIZATION": f"Bearer {token_str}"} self.META = {"HTTP_X_EVIBES_AUTH": f"Bearer {token_str}"}
user, _ = jwt_auth.authenticate(_Req(token)) # type: ignore[arg-type] user, _ = jwt_auth.authenticate(_Req(token)) # type: ignore[arg-type]
scope["user"] = user scope["user"] = user