dj-rest-auth icon indicating copy to clipboard operation
dj-rest-auth copied to clipboard

Existing user email check should be ignore case while social account registration.

Open Aniket-Singla opened this issue 4 years ago • 2 comments

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:

  1. Create a account with '[email protected]'. (normal registration)
  2. 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.

Aniket-Singla avatar Dec 23 '20 18:12 Aniket-Singla

Thanks for raising this issue. Feel free to submit a PR when you get a chance.

iMerica avatar Dec 31 '20 06:12 iMerica

@Aniket-Singla

Steps to reproduce:

  1. Create a account with '[email protected]'. (normal registration)
  2. 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 ?

jerinpetergeorge avatar Jan 15 '21 17:01 jerinpetergeorge