fix: enhance token validation logging for better error tracking and debugging
This commit is contained in:
+4
-1
@@ -149,6 +149,9 @@ async def validate_token(credentials: HTTPAuthorizationCredentials = Security(se
|
||||
logger.debug("Introspection succeeded; claims=%s", verified)
|
||||
|
||||
try:
|
||||
return TokenClaims(**verified)
|
||||
token_claims = TokenClaims(**verified)
|
||||
logger.debug("Token claims parsed successfully: %s", token_claims.model_dump())
|
||||
return token_claims
|
||||
except Exception as exc:
|
||||
logger.error("Unable to parse token claims: %s; verified=%s", exc, verified)
|
||||
raise HTTPException(status_code=401, detail="Unable to parse token claims") from exc
|
||||
|
||||
Reference in New Issue
Block a user