public virtual ActionResult Post(CreatePasswordForm model)
        {
            if (model == null) return HttpNotFound();
            var confirmation = _services.QueryProcessor.Execute(
                new GetEmailConfirmationQuery(model.Token)
            );
            if (confirmation == null) return HttpNotFound();

            if (!ModelState.IsValid) return View(model);

            // execute command
            var command = Mapper.Map<CreatePasswordCommand>(model);
            command.Ticket = TempData.EmailConfirmationTicket();
            _services.CommandHandler.Handle(command);

            // clear the ticket & set the email
            TempData.EmailConfirmationTicket(null);
            TempData.SigningEmailAddress(confirmation.EmailAddress.Value);

            // set feedback message
            SetFeedbackMessage(SuccessMessage);

            // redirect to sign on
            return RedirectToAction(MVC.Identity.SignIn.Get());
        }
        public virtual ActionResult Post(CreatePasswordForm model)
        {
            if (model == null)
            {
                return(HttpNotFound());
            }
            var confirmation = _services.QueryProcessor.Execute(
                new GetEmailConfirmationQuery(model.Token)
                );

            if (confirmation == null)
            {
                return(HttpNotFound());
            }

            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            // execute command
            var command = Mapper.Map <CreatePasswordCommand>(model);

            command.Ticket = TempData.EmailConfirmationTicket();
            _services.CommandHandler.Handle(command);

            // clear the ticket & set the email
            TempData.EmailConfirmationTicket(null);
            TempData.SigningEmailAddress(confirmation.EmailAddress.Value);

            // set feedback message
            SetFeedbackMessage(SuccessMessage);

            // redirect to sign on
            return(RedirectToAction(MVC.Identity.SignIn.Get()));
        }
 public virtual JsonResult ValidatePasswordConfirmation(
     [CustomizeValidator(Properties = CreatePasswordForm.PasswordConfirmationPropertyName)] CreatePasswordForm model)
 {
     return(ValidateRemote(CreatePasswordForm.PasswordConfirmationPropertyName));
 }