Skip to content

Commit

Permalink
user payload handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrOertlin committed Apr 5, 2024
1 parent 9c70095 commit 2cfc98c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion genotype_api/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ async def get_active_user(
store: Store = Depends(get_store),
):
"""Dependency for secure endpoints"""
user = CurrentUser.parse_obj(decode_id_token(token))
payload: dict = decode_id_token(token)
user = CurrentUser(name=payload.get("username"), email=payload.get("email"))
db_user: User = store.get_user_by_email(email=user.email)
if not db_user:
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="User not in DB")
Expand Down

0 comments on commit 2cfc98c

Please sign in to comment.