public ActionResult ChangePassword(ChangePasswordForm form) { // prevent hackers! form.UserName = User.Identity.Name; _changePasswordFormValidator.Validate(form).Populate(ModelState); if (ModelState.IsValid) { _userService.ChangePassword(form.UserName, form.NewPassword); return View("ChangePasswordSuccess"); } return View(form); }
public ActionResult ChangePassword() { var form = new ChangePasswordForm(); return View(form); }