Skip to content

Commit

Permalink
Fix status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Agustinefe committed Mar 6, 2024
1 parent 2041fb5 commit 253bf98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controller/Users.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def handle_create_user(self, user_data: dict):

def handle_login(self, auth_code: str):
user = self.users_service.login(auth_code)
print(user)
return {
"message": user,
"status": status.HTTP_200_OK,
Expand Down
2 changes: 2 additions & 0 deletions app/service/Users.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ def login(self, auth_code: str):
raise AuthenticationError("Authentication code is invalid")

user_info = self._get_user_info(access_token)
print(user_info)
user = self.user_repository.get_user_by_email(user_info["email"])

if user is None:
print("hola")
user = self.user_repository.create_user(**user_info)

return user
Expand Down

0 comments on commit 253bf98

Please sign in to comment.