feat: improve auth error logging with exception type details
Some checks failed
CI / lint-and-test (push) Has been cancelled
Some checks failed
CI / lint-and-test (push) Has been cancelled
This commit is contained in:
@@ -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)):
|
||||
|
||||
Reference in New Issue
Block a user