private ActionResult OnEditSuccess(UserEdit model)
        {
            if (model.UserId != CurrentUser.Id)
            {
                return RedirectToAction(MVC.Accounts.View(model.UserId));
            }

            var user = UserManager.FindByEmail(model.Email);
            if (user == null)
            {
                return RedirectToAction(MVC.Accounts.Login());
            }

            var identity = UserManager.CreateIdentity(user, DefaultAuthenticationTypes.ApplicationCookie);

            AuthenticationManager.SignOut();
            AuthenticationManager.SignIn(new AuthenticationProperties()
            {
                IsPersistent = true,
            }, identity);

            return RedirectToAction(MVC.Accounts.View(model.UserId));
        }
 public virtual ActionResult Edit(UserEdit model)
 {
     return Handle(model, UserService.Edit,
         () => this.OnEditSuccess(model),
         RedirectToAction(MVC.Accounts.Edit(model.UserId)));
 }