0

In the 2.0.0 release issue 2040 was marked as Closed and Fix. When a user is registered and the email address already exists, the message returned is:

•Name [] is already taken. •Email [] is already taken.

This should read Username [] is already taken to prevent confusion.

Will this be corrected or is there another way to address this.

p.s. I have updated to 2.2.0-alpha1 and the issue still exists.

andy
  • 485
  • 1
  • 7
  • 16

1 Answers1

0

You have to manually add correct error message checking the IdentityResults like below.

private void AddErrors(IdentityResult result)
{
    foreach (var error in result.Errors.Where(error => !error.StartsWith("Name")))
    {
        ModelState.AddModelError("", error);
    }
}
DSR
  • 4,588
  • 29
  • 28
  • My explanation code will return Email is already taken only. It is is ignoring "Name is already taken" section. You need to change the implementation to support your needs BTW. – DSR Nov 06 '14 at 15:41