Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset Password bug #12705

Closed
intellimedhu opened this issue Oct 24, 2022 · 2 comments · Fixed by #15736
Closed

Reset Password bug #12705

intellimedhu opened this issue Oct 24, 2022 · 2 comments · Fixed by #15736
Milestone

Comments

@intellimedhu
Copy link

Describe the bug:

Reset password doesn't work as expected when RequireUniqueEmail is false. When trying to reset the password it changes the password of the first user found. The problem occurs when a new user is created with the same email. See related lines here

Related bug:

Change password operation from the dashboard produces the same result. See here

To Reproduce

  1. services.Configure<IdentityOptions>(o => o.User.RequireUniqueEmail = false);
  2. Create 2 users from code with the same emails
  3. Try to reset passwords

Expected behavior

Should check the RequireUniqueEmail option. In case of false value have to find another way how user should identify herself/himself (username?).

@hishamco
Copy link
Member

Good catch, nothing but I presume the reason for that because we are using email as username for that we need to make unique

Either we need to fix this or provide a proper docs for that

@sebastienros sebastienros added this to the 1.x milestone Nov 3, 2022
@sebastienros sebastienros added the P0 label Nov 3, 2022
@sebastienros
Copy link
Member

var user = await _userService.GetForgotPasswordUserAsync(model.Email) as User; should use a user id instead of an email. We also need to check every time we use this method we don't use an email.

Or check that if the option is set, we shouldn't ask for an email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants