Skip to content

Commit

Permalink
api(google): fix urgent sign up issue (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
caio-felipee authored Dec 1, 2023
1 parent d6fa94e commit 81f08ef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/users/backends/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ def get_user_data(cls, access_token: str) -> dict | None:

@staticmethod
def do_auth(user_data: dict) -> User | None:
user, created = User.objects.get_or_create(
email=user_data['email'])
user, _ = User.objects.get_or_create(
email=user_data['email'],
username=user_data['email']
)

if user_data.get('given_name'):
user.first_name = user_data['given_name']
Expand Down

0 comments on commit 81f08ef

Please sign in to comment.