Esempio n. 1
0
        public ActionResult ResetPassword(ResetPasswordForm form)
        {
            if (ModelState.IsValid)
            {
                var user = _userService.GetUserByResetPasswordKey(form.ResetPasswordKey);
                if (user == null) return new HttpNotFoundResult();

                _userService.ResetPassword(user, form.Password);
                FormsAuthentication.SetAuthCookie(user.UserName, true);
                return RedirectToAction("Index", "Home");
            }

            return View(form);
        }
Esempio n. 2
0
        public ActionResult ResetPassword(Guid id)
        {
            var user = _userService.GetUserByResetPasswordKey(id);
            if (user == null) return new HttpNotFoundResult();

            var form = new ResetPasswordForm(id);
            return View(form);
        }