public ActionResult Confirm(ChangePasswordFromResetKeyInputModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    NhUserAccount account;
                    if (this.userAccountService.ChangePasswordFromResetKey(model.Key, model.Password, out account))
                    {
                        this.authenticationService.SignIn(account);
                        if (account.RequiresTwoFactorAuthCodeToSignIn())
                        {
                            return RedirectToAction("TwoFactorAuthCodeLogin", "Login");
                        }
                        if (account.RequiresTwoFactorCertificateToSignIn())
                        {
                            return RedirectToAction("CertificateLogin", "Login");
                        }

                        return RedirectToAction("Success");
                    }
                    else
                    {
                        ModelState.AddModelError("", "Error changing password. The key might be invalid.");
                    }
                }
                catch (ValidationException ex)
                {
                    ModelState.AddModelError("", ex.Message);
                }
            }
            return View();
        }
 public ActionResult Confirm(string id)
 {
     var vm = new ChangePasswordFromResetKeyInputModel()
     {
         Key = id
     };
     return View("Confirm", vm);
 }