django-rest-framework-social-oauth2 icon indicating copy to clipboard operation
django-rest-framework-social-oauth2 copied to clipboard

already registered emails bug fixed

Open hrahmadi71 opened this issue 6 years ago • 1 comments

In such case that user email is unique and normal user registering is available: If a user tries to social sign-in with a registered email, it will end up with db error saying the email is already exists! For example assume this scenario: 1- user register normally (using normal register form) with his/her gmail. 2- the user tries to login by google with the same gmail address. as I mentioned above, convert-token request will response with 500 error because of db error. I fixed this problem by catching this error in oauth2_grants file (SocialTokenGrant.validate_token_request method).

hrahmadi71 avatar Dec 12 '19 11:12 hrahmadi71

Hi! Can you please push this change to pip? I'm facing the same problem. Thanks

fabiovasini avatar Oct 22 '20 13:10 fabiovasini