Skip to content

Commit

Permalink
Fixed methods that relied on an older implementation of the authentic…
Browse files Browse the repository at this point in the history
…ate() method
  • Loading branch information
ReallyWeirdCat committed Dec 7, 2024
1 parent 2bff091 commit b458c9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/app/controllers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 1 addition & 5 deletions backend/app/services/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b458c9a

Please sign in to comment.