public async Task <IHttpActionResult> ChangePassword(ChangingPasswordDTO model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } IdentityResult result = await _Repository.ChangePassword(User.Identity.GetUserId(), model); if (!result.Succeeded) { return(GetErrorResult(result)); } return(Ok()); }
public async Task <IdentityResult> ChangePassword(string id, ChangingPasswordDTO model) { return(await _userManager.ChangePasswordAsync(id, model.OldPassword, model.NewPassword)); }