Change password is a common functionality which is used in almost every app that takes user credentials to login.
In ASP.Net Identity, we have the inbuilt method to change the password of currently logged in user.
Here is the sample code for the same
IdentityResult result = await UserManager.ChangePasswordAsync(User.Identity.GetUserId(), oldPassword, newPassword);
Here we are making a request for changing the password using currently logged in userId(User.Identity.GetUserId()), oldPassword and newPassword as parameter. ChangePasswordAsync is a method of ApplicationUserManager which has methods for all the functionality related to user account
0 Comment(s)