I am using Django's default User model and the email is not unique, now I have multiple users with the same email address.
You can have User_A with email address [email protected], and then a new user User_B can register with the same email address [email protected].
This doesn't make sense in any programming universe, and it will cause confusion with email-sending functionality, and possible wrong password resets (if a password reset link is sent, with two users sharing the same email address).
This doesn't hold an obvious security vulnerability as I see it because only the original user has control of the original email address, so the attacker will not receive the reset emails.
However, this could result in the original user User_A being locked out of his original account (if he forgets his password) and being prevented of issuing a password reset because Django attempts to reset the new user User_B only. Obviously User_A wants access to his account, not to User_B's account.
The password reset functionality is indeed based on email addresses.
It will send a reset email to all accounts that have a corresponding email.
The context passed to the email template includes the user
, so your email reset message may include the username to let the user identify which password this would reset.
All of these may be overriden by using:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With