Skip to content

Commit

Permalink
Add async handling to user authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
ahdamin committed Oct 7, 2024
1 parent a2d96d4 commit 5df584c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions genotype_api/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from genotype_api.config import security_settings
from genotype_api.database.models import User
from genotype_api.database.store import get_store, Store
from genotype_api.database.store import Store, get_store
from genotype_api.dto.user import CurrentUser


Expand Down Expand Up @@ -69,7 +69,7 @@ async def get_active_user(
) -> CurrentUser:
"""Dependency for secure endpoints"""
user_email = token_info["payload"]["email"]
db_user: User = store.get_user_by_email(email=user_email)
db_user: User = await 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")
return CurrentUser(
Expand Down

0 comments on commit 5df584c

Please sign in to comment.