wagnerdelima / drf-social-oauth2

drf-social-oauth2 makes it easy to integrate Django social authentication with major OAuth2 providers, i.e., Facebook, Twitter, Google, etc.
https://drf-social-oauth2.readthedocs.io/en/latest/
MIT License
269 stars 34 forks source link

Problem with existing email #228

Open Damian232 opened 4 weeks ago

Damian232 commented 4 weeks ago

Hello,

I found a problem with signing up by email that is already used. For example someone login in and sign up throughout normal password based. Then he tries to login using google gmail account since its the same email we used.

This behavior throws error 500 with duplicate key (handling in convert-token view). Of course I can modify library by myself but every time i go and rebuild my docker container the package is rebuild.

Is there anyway you can add some kind of exception that when the email already exists then view returns not 500 but for example 403 already exists with appropriate message email:backend-type so on the frontend side we can catch it and returns that to user.

Of course i would be very happy to collaborate on that if you are lacking time ;)

Thanks very much in advance