示例#1
0
        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
            }));
        }
示例#2
0
 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));
 }