I am new to Web API ,Here I am working in a token based authentication . I done all the login and Signup process with AspNetUsers table except the update password functionalities.
Here I have updated the HashedPassword field by passing the new password .When I try to get token for the specific user it returns some error related with passwordHash format because it directly save the new password without hash.
code :
public string updateUserData(string mEmail,string mPassword)
{
if (ModelState.IsValid)
{
var userStore = new UserStore<ApplicationUser>(new ApplicationDbContext());
var manager = new UserManager<ApplicationUser>(userStore);
ApplicationUser AppModel = manager.FindByEmail(mEmail);
AppModel.PasswordHash = mPassword;
manager.Update(AppModel);
return "Success";
}
return "Update Failed";
}
can anyone help me to do this in a proper way .I am new to this if I did any silly mistake I am asking sorry for that.