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:
parent
4658f086ae
commit
3e2e2cecbb
1 changed files with 1 additions and 1 deletions
|
|
@ -136,7 +136,7 @@ async def get_current_user_by_jwt(
|
||||||
headers={"WWW-Authenticate": "Bearer"},
|
headers={"WWW-Authenticate": "Bearer"},
|
||||||
)
|
)
|
||||||
except JWTError as e:
|
except JWTError as e:
|
||||||
logger.exception("JWT decoding error")
|
logger.debug("JWT validation failed: Invalid token format or signature")
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||||
detail="Could not validate credentials",
|
detail="Could not validate credentials",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue