Try our conversational search powered by Generative AI!
AI OnAI Off
Just an update, I've resolved this. In case anyone runs into this, it turns out that the token was not URL-friendly, and so I had to wrap it in a HttpUtility.UrlEncode() like so:
string resetLink = "<a href='http://www.redacteddomain.com/my-account/reset-password/?rt=" + HttpUtility.UrlEncode(token.Result) + "&userId=" + user.Id + "'>Click this link to reset your password.</a>";
After that it worked just fine.
Hello,
I'm migrating our newly updated CMS10/Commerce website from using the old .net Membership references to Episerver's aspnetidentity. Everything is going pretty well but I've hit a snag with Identity's change password functionality. No matter what, it keeps telling me that the token I generated is invalid.
Here is my UserManager:
Here is the TokenProvider class:
Here is the code that generates and sends the reset password link to the user:
And lastly, here is the code for the change password page that the user gets a link to in their e-mail. the variable "rt" is the reset token:
I've confirmed that both userid and the token are not null and match what was sent as url parameters in the link sent to the user. Can anyone tell me what I might be missing? I'm new to .NET Identity.
Thanks in advance!
John