From b458c9a67993b19fa25dd5911b982c0da7d1d973 Mon Sep 17 00:00:00 2001 From: Nikolai Papin Date: Sat, 7 Dec 2024 17:57:44 +0300 Subject: [PATCH] Fixed methods that relied on an older implementation of the authenticate() method --- backend/app/controllers/user.py | 2 +- backend/app/services/auth.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/backend/app/controllers/user.py b/backend/app/controllers/user.py index 7cd466f..985e5c1 100644 --- a/backend/app/controllers/user.py +++ b/backend/app/controllers/user.py @@ -45,4 +45,4 @@ def complete_user_registration( def get_user_profile(self, user: Annotated[UserAccount, Depends(AuthService.authenticate)]) -> UserProfile: """Get user profile.""" - return UserService.get_user_profile(user.user_id) + return UserService.get_user_profile(user.id) diff --git a/backend/app/services/auth.py b/backend/app/services/auth.py index 469185f..663c4db 100644 --- a/backend/app/services/auth.py +++ b/backend/app/services/auth.py @@ -247,8 +247,4 @@ def authenticate(cls, credentials: HTTPAuthorizationCredentials = Depends(http_b detail="Could not validate credentials" ) - return UserAccount( - user_id=user.id, - username=user.login_data.username, - role=user.role - ) + return user