log only if not successful

This commit is contained in:
msramalho
2023-03-09 11:41:40 +00:00
parent f119f2f2b3
commit 1a25a806a2

View File

@@ -20,8 +20,8 @@ async def get_bearer_auth(credentials: HTTPAuthorizationCredentials = Depends(be
# validates the Bearer token in the case that it requires it
access_token = credentials.credentials
valid_user, info = authenticate_user(access_token)
logger.debug(f"TOKEN authentication: {valid_user=} {info=}")
if valid_user: return info
logger.debug(f"TOKEN FAILURE: {valid_user=} {info=}")
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=info,