From 0bdfae63732d5473385d0a6c6788345cc678c741 Mon Sep 17 00:00:00 2001 From: Tomas Kracmar Date: Tue, 14 Apr 2026 16:33:32 +0200 Subject: [PATCH] feat: improve auth error logging with exception type details --- backend/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/auth.py b/backend/auth.py index 15c1bc4..746b923 100644 --- a/backend/auth.py +++ b/backend/auth.py @@ -68,8 +68,8 @@ def _decode_token(token: str, jwks): except HTTPException: raise except Exception as exc: - logger.warning("Token verification failed", error=str(exc)) - raise HTTPException(status_code=401, detail="Invalid token") from None + logger.warning("Token verification failed", error_type=type(exc).__name__, error=str(exc)) + raise HTTPException(status_code=401, detail=f"Invalid token ({type(exc).__name__})") from None def require_auth(authorization: str | None = Header(None)):