public ActionResult PasswordResetConfirm(string id) { var vm = new ChangePasswordFromResetKeyModel() { Key = id }; return View("PasswordResetConfirm", vm); }
public ActionResult PasswordResetConfirm(ChangePasswordFromResetKeyModel model) { if (ModelState.IsValid) { try { if (_userService.ChangePasswordFromResetKey(model.Key, model.Password)) { return View("PasswordResetSuccess"); } ModelState.AddModelError("", "Error changing password. The key might be invalid."); } catch (ValidationException ex) { ModelState.AddModelError("", ex.Message); } } return View(); }