public ActionResult Confirm(ChangeEmailFromKeyInputModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    if (this.userAccountService.ChangeEmailFromKey(User.GetUserID(), model.Password, model.Key, model.NewEmail))
                    {
                        // since we've changed the email, we need to re-issue the cookie that
                        // contains the claims.
                        var account = this.userAccountService.GetByEmail(model.NewEmail);
                        authSvc.SignIn(account);
                        return View("Success");
                    }

                    ModelState.AddModelError("", "Error changing email.");
                }
                catch (ValidationException ex)
                {
                    ModelState.AddModelError("", ex.Message);
                }
            }
            
            return View("Confirm", model);
        }
        public ActionResult Confirm(string id)
        {
            var account = this.userAccountService.GetByVerificationKey(id);
            if (account == null)
            {
                ModelState.AddModelError("", Resources.ValidationMessages.InvalidKey);
                return View("Index");
            }

            if (account.HasPassword())
            {
                var vm = new ChangeEmailFromKeyInputModel();
                vm.Key = id;
                return View("Confirm", vm);
            }
            else
            {
                try
                {
                    userAccountService.VerifyEmailFromKey(id, out account);
                    // since we've changed the email, we need to re-issue the cookie that
                    // contains the claims.
                    authSvc.SignIn(account);
                    return RedirectToAction("Success");
                }
                catch (ValidationException ex)
                {
                    ModelState.AddModelError("", ex.Message);
                }
                return View("Confirm", null);
            }
        }
        public ActionResult Confirm(ChangeEmailFromKeyInputModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    if (this.userAccountService.ChangeEmailFromKey(model.Password, model.Key, model.NewEmail))
                    {
                        return View("Success");
                    }

                    ModelState.AddModelError("", "Error changing email.");
                }
                catch (ValidationException ex)
                {
                    ModelState.AddModelError("", ex.Message);
                }
            }
            
            return View("Confirm", model);
        }
 public ActionResult Confirm(ChangeEmailFromKeyInputModel model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             BrockAllen.MembershipReboot.UserAccount account;
             this.userAccountService.VerifyEmailFromKey(model.Key, model.Password, out account);
             
             // since we've changed the email, we need to re-issue the cookie that
             // contains the claims.
             authSvc.SignIn(account);
             return RedirectToAction("Success");
         }
         catch (ValidationException ex)
         {
             ModelState.AddModelError("", ex.Message);
         }
     }
     
     return View("Confirm", model);
 }
 public ActionResult Confirm(string id)
 {
     var vm = new ChangeEmailFromKeyInputModel();
     vm.Key = id;
     return View("Confirm", vm);
 }