Skip to content

Commit

Permalink
fix: revert to use default value in get_username
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennifer Tran committed Apr 29, 2024
1 parent dbb62fb commit f640fdf
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ingest_api/runtime/src/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ def validated_token(
def get_username(token: Annotated[Dict[Any, Any], Depends(validated_token)]) -> str:
logger.info(f"\nToken {token}")
result = token["username"] if "username" in token else token.get("sub", None)
if result is None:
raise KeyError(f"Neither 'username' nor 'sub' found in the token: {token}.")
return result


Expand Down

0 comments on commit f640fdf

Please sign in to comment.