public async Task<IdentityResult> ChangePassword(string userId, ChangePasswordModel changePasswordModel) { var result = await _userManager.ChangePasswordAsync(userId, changePasswordModel.CurrentPassword, changePasswordModel.Password); return result; }
public async Task<IHttpActionResult> ChangePassword(ChangePasswordModel changePasswordModel) { if (!ModelState.IsValid) { return BadRequest(ModelState); } var userId = HttpContext.Current.User.Identity.GetUserId(); var result = await _repo.ChangePassword(userId, changePasswordModel); var errorResult = GetErrorResult(result); if (errorResult != null) { return errorResult; } return Ok(); }