public IActionResult UpdatePassword(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var model = new UpdatePasswordAccountViewModel {
                HashIdUser = id
            };

            return(View(model));
        }
Пример #2
0
        public async Task <IActionResult> UpdatePasswordConfirmed(UpdatePasswordAccountViewModel vm)
        {
            if (ModelState.IsValid)
            {
                var result = await _accountService.UpdatePasswordAsync(_mapper.Map <UpdateAccountPasswordDTO>(vm));

                if (result.IsValid)
                {
                    return(RedirectToAction("Index"));
                }
                TempData["ErrorsListConfirmed"] = result.ErrorsList;
            }
            return(View(vm));
        }
        public async Task <IActionResult> UpdatePasswordConfirmed(UpdatePasswordAccountViewModel vm)
        {
            if (ModelState.IsValid)
            {
                var result = await _accountService.UpdatePasswordAsync(_mapper.Map <UpdateAccountPasswordDTO>(vm));

                if (result.IsValid)
                {
                    await _systemAuditService.AuditAsync(User.GetEmail(), _accessor.GetIp(), Operations.Update, Tables.AspNetUsers, "PasswordHash");

                    return(RedirectToAction("Index"));
                }
                TempData["ErrorsListConfirmed"] = result.ErrorsList;
            }
            return(View(vm));
        }
        public async Task <IActionResult> UpdatePasswordConfirmed(UpdatePasswordAccountViewModel vm)
        {
            if (ModelState.IsValid)
            {
                if (vm.HashIdUser == null)
                {
                    return(NotFound());
                }
                var result = await _accountService.UpdateUserPasswordAsync(_mapper.Map <AccountDTO>(vm));

                return(result.IsValid
                    ? RedirectToAction("Index")
                    : _oops.OutPutError("Account", "Index", result.ErrorsList));
            }
            return(View(vm));
        }