I am wondering if there is a way to reset password with UserManager
of ASP.NET MVC 5
I tried this with user that already has a password bu
Try this code .It is working perfectly:
var userStore = new UserStore();
var userManager = new UserManager(userStore);
string userName= UserName.Text;
var user =userManager.FindByName(userName);
if (user.PasswordHash != null )
{
userManager.RemovePassword(user.Id);
}
userManager.AddPassword(user.Id, newpassword);