Wednesday 6 September 2017

Reset password using entity framework

In this case you will be treating ChangePassword as Reset Password. You can achieve this by using reset password by generating token and using that token straightaway to validate it with new password.



var userId = User.Identity.GetUserId();

var token = await UserManager.GeneratePasswordResetTokenAsync(userId);

var result = await UserManager.ResetPasswordAsync(userId, token, newPassword);

No comments:

Post a Comment