fix: use separate except clauses for JWT verification fallback
All checks were successful
CI / backend-tests (pull_request) Successful in 29s
CI / frontend-tests (pull_request) Successful in 29s

ruff format strips parentheses from `except (A, B):`, turning it into
Python 2 comma syntax that only catches the first exception. Use
separate except clauses so PyJWKClientError is actually caught.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-22 09:52:33 +01:00
parent 291eba63a7
commit 41a18edb4f

View File

@@ -71,7 +71,9 @@ def _verify_jwt(token: str) -> dict | None:
algorithms=["RS256"],
audience="authenticated",
)
except jwt.InvalidTokenError, PyJWKClientError:
except jwt.InvalidTokenError:
pass
except PyJWKClientError:
pass
return _verify_jwt_hs256(token)