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

Bug: doesn't check duplicated email while changing user's email address #2081

hez2010 opened this Issue Nov 27, 2018 · 2 comments


None yet
2 participants

hez2010 commented Nov 27, 2018

When I call UserManager.SetEmailAsync(), it doesn't validate whether there's duplicated email address in database which could cause more than one users having the same email address.

If there're any duplicated email addresses in database, the UserManager.FindByEmailAsync() will not working properly -- it only return one result but not all matching results.

Therefore, it's necessary to validate duplicated email address while creating user and changing user's email address.


This comment has been minimized.


blowdart commented Nov 29, 2018

Have you set the RequireUniqueEmail setting in UserOptions? This is off by default. We expect uniqueness on usernames, not emails.

@blowdart blowdart added the question label Nov 29, 2018


This comment has been minimized.

hez2010 commented Nov 30, 2018

Thanks, this fix my problem.
But I think that the FindByEmailAsync should return an IEnumerable<TUser>, but not TUser.

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