refactor: Improve JWT error logging for better debugging of authentication issues (#5885)

fix: improve JWT error logging for better debugging of authentication issues
This commit is contained in:
Gabriel Luiz Freitas Almeida
2025-01-29 00:04:35 -03:00
committed by GitHub
parent 4658f086ae
commit 3e2e2cecbb

View File

@ -136,7 +136,7 @@ async def get_current_user_by_jwt(
headers={"WWW-Authenticate": "Bearer"},
)
except JWTError as e:
logger.exception("JWT decoding error")
logger.debug("JWT validation failed: Invalid token format or signature")
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Could not validate credentials",