public ActionResult SignInHelp() { SignInHelpViewModel model = new SignInHelpViewModel(); if (Request.Cookies[EMAIL_COOKIE_NAME] != null) { model.Email = Server.HtmlEncode(Request.Cookies[EMAIL_COOKIE_NAME].Value); } return PartialView("_SignInHelpForm", model); }
public ActionResult SignInHelp(SignInHelpViewModel model) { if (ModelState.IsValid) { Account account = _accountService.GetByEmail(model.Email); if (account != null) { _accountService.ResetPassword(account); TempData["infomessage"] = "Your password has been reset and emailed to you. Please check your email and return here to sign in."; return JsonRedirect(Url.Action("signin", "signin")); } else { model.Message = "An account could not be found for that email address."; } return JsonContent("#sign-in-form-panel", RenderPartialViewToString("_SignInHelpForm", model)); } return PartialView("_SignInHelpForm", model); }