How to reset password with UserManager of ASP.NET MVC 5

后端 未结 7 1603
情深已故
情深已故 2021-01-30 06:36

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

7条回答
  •  梦如初夏
    2021-01-30 07:34

    It is here ASP.NET Identity reset password

    UserManager userManager = 
        new UserManager(new UserStore());
    
    userManager.RemovePassword(userId);
    
    userManager.AddPassword(userId, newPassword);
    

提交回复
热议问题