Search code examples
c#asp.net-coreasp.net-identity

How to retrieve email confirmation token code?


"ConfirmEmailAsync" this method confirms the email.

But I dont want to confirm the email just yet instead I want to verify the email token code first and if email token code is valid, do something and then execute ConfirmEmailAsync.


EDIT There is "VerifyUserTokenAsync", but what is the value for provider and purpose?


Solution

  • Found the solution:

            bool IsEmailCodeValid = await _userManager.VerifyUserTokenAsync(user, "Default", "EmailConfirmation", code);