dlmelendez / identityazuretable

This project provides a high performance cloud solution for ASP.NET Identity Core using Azure Table storage replacing the Entity Framework / MSSQL provider.
MIT License
104 stars 27 forks source link

Changing Username does not purge index records #67

Closed AlexMedia closed 3 years ago

AlexMedia commented 4 years ago

I'm currently working on a project with the following set-up:

I have come across an issue whereby the old username is not freed up after changing it via the Account area.

Steps to reproduce:

  1. Create an account via the normal registration and confirmation flow
  2. Log on, go into Account > Email, change Email, go through confirmation flow
  3. Confirm that you can log in with the new email address
  4. Log off
  5. Try to register a new account using the previously used email address. The following error message appears:

    User name 'old-email@address.tld' is already taken.

I've done some investigation, and I suspect that the issue is caused by records in the AspNetIndex table not being cleaned up properly when the rename takes place.

In the source I see that SetEmailAsync is overridden to purge records from the index table, but no such thing seems to happen for SetUserNameAsync.

dlmelendez commented 3 years ago

@AlexMedia appreciate you filing this issue. Assigned to next release. Thank you for including all the information needed to debug the issue!

dlmelendez commented 3 years ago

fixed in v5-rc2