fix: use separate except clauses for JWT verification fallback
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:
@@ -71,7 +71,9 @@ def _verify_jwt(token: str) -> dict | None:
|
|||||||
algorithms=["RS256"],
|
algorithms=["RS256"],
|
||||||
audience="authenticated",
|
audience="authenticated",
|
||||||
)
|
)
|
||||||
except jwt.InvalidTokenError, PyJWKClientError:
|
except jwt.InvalidTokenError:
|
||||||
|
pass
|
||||||
|
except PyJWKClientError:
|
||||||
pass
|
pass
|
||||||
return _verify_jwt_hs256(token)
|
return _verify_jwt_hs256(token)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user