public ActionResult ForgotSecurePhrase(ForgotPasswordPhraseViewModel model) { var step1Token = GetFirstStepSecurityToken(); if (String.IsNullOrEmpty(step1Token)) { AddModelStateError(GlobalStrings.FirstLoginStepMustBeDoneBeforeResetSecurePhrase); return View(model); } return ForgotSecurePhrase(model, step1Token); }
public ActionResult ForgotPassword(ForgotPasswordPhraseViewModel model) { if (ModelState.IsValid) { if (RequestPasswordReset(model)) return RedirectToAction("ForgotPasswordConfirmation"); } // If we got this far, something failed, redisplay form return View(model); }
private bool RequestPasswordReset(ForgotPasswordPhraseViewModel model) { try { this.Service.InitiateResetPassword(model.Email); return true; } catch (UserDoesNotExistException) { AddModelStateError(GlobalStrings.UserDoesNotExists); return false; } catch (Exception) { AddModelStateError(GlobalStrings.SomethingWentWrong); return false; } }
private ActionResult ForgotSecurePhrase(ForgotPasswordPhraseViewModel model, string token) { if (ModelState.IsValid) { if (RequestSecurePhraseReset(model, token)) return RedirectToAction("ForgotSecurePhraseConfirmation"); } return View(model); }