iMerica / dj-rest-auth

Authentication for Django Rest Framework
https://dj-rest-auth.readthedocs.io/en/latest/index.html
MIT License
1.62k stars 302 forks source link

Breaking Bug since Allauth v0.63.1 when registering using Google "User is already registered with this e-mail address" #641

Open adrenaline681 opened 4 weeks ago

adrenaline681 commented 4 weeks ago

After updating the packages of our application to the latest version we found a bug when a user registers using Google. The API endpoint errors out with this message:

User is already registered with this e-mail address

I can confirm that there is no user registered with this email address before I send the request. The odd thing is that this user does get created properly in the database. So it's almost like it's creating the user once, and then trying again and failing.

Here is how my view looks like.

class GoogleLoginView(SocialLoginView):
    adapter_class = GoogleOAuth2Adapter
    client_class = OAuth2Client

I can confirm that this issue is not happening with Allauth v0.63.0 but does happen with v0.63.1

Not sure if this issue might be related but in there it was mentioned that the issue could be in dj-rest-auth

famoseagle commented 4 weeks ago

I originally posted this issue on allauth. See @pennersr's comment. The breaking change relates to this commit which affects this conditional in dj-rest-auth.

Do you need that block if allauth already checks for existing users?