AspNetIdentity
AspNetIdentity copied to clipboard
Checking to see if email confirmation token has expired
Is there a way to do this? Like an error code that will return when the email confirmation token has expired? For example if the error code was "TokenExpired" I could use the following to return the user to a specific view which gives them advice on a process to follow if their token has expired:
var result = await _userManager.ConfirmEmailAsync(user, code);
if (result.Succeeded) return View("ConfirmEmail");
return View(result.Errors.Any(c => c.Code == "TokenExpired") ? "TokenExpired" : "Error");
@egmfrs take a look at this https://github.com/aspnet/Identity/issues/307#issuecomment-407731661 I had same problem.
Thanks for sharing @Misiu
@egmfrs please let me know if this will work for You. I've created that code a couple of hours ago and it still needs tests, so any comments are more than welcome.