Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion litestar/security/jwt/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,5 +251,6 @@ async def authenticate_request(self, connection: ASGIConnection[Any, Any, Any, A
auth_header = connection.headers.get(self.auth_header) or connection.cookies.get(self.auth_cookie_key)
if not auth_header:
raise NotAuthorizedException("No JWT token found in request header or cookies")
encoded_token = auth_header.partition(" ")[-1]
parts = auth_header.strip().split(maxsplit=1)
encoded_token = parts[-1] if parts else ""
return await self.authenticate_token(encoded_token=encoded_token, connection=connection)
Loading