コード例 #1
0
        public async Task <ActionResult> ResetPassword(LoginResetPasswordViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            try
            {
                await UserManagementMicroService.ResetPasswordAsync(model.UserId, model.Password, model.Code);

                return(RedirectToAction("ResetPasswordConfirmation", "Login"));
            }
            catch (ServiceException ex)
            {
                AddModelErrors(ex);
                return(View());
            }
        }
コード例 #2
0
        public async Task <ActionResult> ResetPassword(string userId, string code)
        {
            try
            {
                var email = await UserMicroService.GetUserEmailAsync(userId);

                var model = new LoginResetPasswordViewModel()
                {
                    UserId = userId,
                    Code   = code,
                    Email  = email
                };

                return(View(model));
            }
            catch (ServiceException ex)
            {
                AddModelErrors(ex);
                return(View());
            }
        }