Skip to content

Added google login new params with fix to facebook login#13

Open
DinithHerath wants to merge 4 commits into
huychau:masterfrom
DinithHerath:master
Open

Added google login new params with fix to facebook login#13
DinithHerath wants to merge 4 commits into
huychau:masterfrom
DinithHerath:master

Conversation

@DinithHerath
Copy link
Copy Markdown

@DinithHerath DinithHerath commented Feb 9, 2022

  • Updated google login from
first_name=user_data.get('first_name'),
last_name=user_data.get('last_name'),

to

first_name=user_data.get('given_name'),
last_name=user_data.get('family_name'),
  • Also added the Facebook login with the google login.
  • Updated the Facebook graph API version to 13.0 as well.

@DinithHerath DinithHerath changed the title Added google login new params Added google login new params with fix to facebook login Feb 9, 2022
first_name=user_data.get('first_name'),
last_name=user_data.get('last_name'),
)
if (provider == FACEBOOK_PROVIDER):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DinithHerath Many thanks for your update. I think we don't need to check the provider, the implementation like this:

 user = User.objects.create(
    username=user_data['email'],
    email=user_data['email'],
    first_name=user_data.get('first_name') or user_data.get('given_name'),
    last_name=user_data.get('last_name') or user_data.get('family_name'),
 )

Feel free to check and update, I will merge after that. Sorry for late response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants