public ActionResult Index(ChangeEmailRequestInputModel model) { if (!ModelState.IsValid) { return(View("Index", model)); } try { _userAccountService.ChangeEmailRequest(User.GetId(), model.NewEmail); return(_userAccountService.Configuration.RequireAccountVerification ? View("ChangeRequestSuccess", model.NewEmail) : View("Success")); } catch (AuthenticationException) { return(new HttpUnauthorizedResult()); } catch (ValidationException ex) { ModelState.AddModelError("", ex.Message); } return(View("Index", model)); }
public ActionResult Index(ChangeEmailRequestInputModel model) { if (ModelState.IsValid) { try { this.userAccountService.ChangeEmailRequest(User.GetUserID(), model.NewEmail); return(View("ChangeRequestSuccess", (object)model.NewEmail)); } catch (ValidationException ex) { ModelState.AddModelError("", ex.Message); } } return(View("Index", model)); }
public ActionResult Index(ChangeEmailRequestInputModel model) { if (ModelState.IsValid) { try { if (this.userAccountService.ChangeEmailRequest(User.Identity.Name, model.NewEmail)) { return(View("ChangeRequestSuccess", (object)model.NewEmail)); } ModelState.AddModelError("", "Error requesting email change."); } catch (ValidationException ex) { ModelState.AddModelError("", ex.Message); } } return(View("Index", model)); }