From 41a18edb4f9eb65ee0be828141a0a8bc3d2a5b0d Mon Sep 17 00:00:00 2001 From: Julian Tabel Date: Sun, 22 Mar 2026 09:52:33 +0100 Subject: [PATCH] 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) --- backend/src/app/core/auth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/app/core/auth.py b/backend/src/app/core/auth.py index d717aca..8423779 100644 --- a/backend/src/app/core/auth.py +++ b/backend/src/app/core/auth.py @@ -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) -- 2.49.1