public async Task<IHttpActionResult> ChangePassword(ChangePasswordViewModel changePasswordViewModel) { if (!ModelState.IsValid) { return BadRequest(ModelState); } IdentityResult result = await _repo.ChangePassword(changePasswordViewModel); IHttpActionResult errorResult = GetErrorResult(result); if (errorResult != null) { return errorResult; } return Ok(); }
public async Task<IdentityResult> ChangePassword(ChangePasswordViewModel changePasswordViewModel) { IdentityResult result = await UserManager.ChangePasswordAsync(changePasswordViewModel.UserName, changePasswordViewModel.OldPassword, changePasswordViewModel.NewPassword); return result; }