dj-rest-auth
dj-rest-auth copied to clipboard
Existing user email check should be ignore case while social account registration.
https://github.com/jazzband/dj-rest-auth/blob/f6d8468e0048fc84de769c053af395ca7b0678f9/dj_rest_auth/registration/serializers.py#L142
I am currently working on user registration flow and was specifically working on social signins for existing users (custom implemetation as not supported by allauth and dj-rest-auth). I came to find this bug while doing that implementation.
Steps to reproduce:
- Create a account with '[email protected]'. (normal registration)
- Use the social account for signup '[email protected]' and there you go you will have two diferrent accounts with same email.
Some people might argue that emails are case sensitive, but you wont actually find diferrent persons with [email protected] and [email protected]. I mean most of the leading mail providers considers them to be insensitive in 2020.
I have shared where exactly the correction is required in the link above.
Thanks for raising this issue. Feel free to submit a PR when you get a chance.
@Aniket-Singla
Steps to reproduce:
- Create a account with '[email protected]'. (normal registration)
- Use the social account for signup '[email protected]' and there you go you will have two diferrent accounts with same email.
During the social auth registration, we are validating the email against case-insensitive data (ref: RegisterSerializer class). Which means, we will not able to create an account with an existing email.
The social-auth login is something that comes after the social-auth registration and hence I feel we will not face any issues unless we forgot to put the condition in the RegisterSerializer class.
am I right @iMerica ?