Пример #1
0
        public ActionResult ResetPassword(ResetPasswordViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                if (this.userManager.UserExists(viewModel.UserId))
                {
                    var result = this.userManager.ResetPassword(
                        viewModel.UserId, viewModel.PasswordResetToken, viewModel.NewPassword);

                    if (result.Succeeded)
                    {
                        return base.Home();
                    }
                }

                return base.DefaultError();
            }
            return View(viewModel);
        }
Пример #2
0
 public ActionResult ResetPassword(string userId, string passwordToken)
 {
     if (passwordToken != null && this.userManager.UserExists(userId))
     {
         var viewModel = new ResetPasswordViewModel
         {
             UserId = userId,
             PasswordResetToken = passwordToken,
         };
         return View(viewModel);
     }
     return base.DefaultError();
 }