public async Task <ActionResult <SuccessResponseApiModel> > Change(ChangePasswordApiModel model) { var userId = GetUserId(); await _passwordManager.ChangePasswordAsync(userId, model.OldPassword, model.NewPassword); return(SuccessResult(new SuccessResponseApiModel() { Response = "success", Id = userId })); }
public async Task ChangePasswordAsync(ChangePasswordViewModel viewModel, string token = null) { try { await _passwordManager.ChangePasswordAsync( new Business.Password.Models.ChangePasswordRequest(viewModel.Password, token)); } catch (AutoMapperMappingException e) { if (e.InnerException is Business.Password.Exceptions.ExpiredTokenException) { throw new ExpiredChangePasswordRequestException(); } else { throw e; } } }
public Task <InvokeResult> ChangePasswordAsync([FromBody] ChangePassword changePassword) { return(_passwordMangaer.ChangePasswordAsync(changePassword, OrgEntityHeader, UserEntityHeader)); }