public ActionResult ResetPassword(ResetPasswordViewModel model) { try { if (ModelState.IsValid) { SetRequestURL(APIURL.APPLICANT_RESET_PASSWORD, Method.POST); request.AddBody(model); var response = rest.Execute(request); if (response.StatusCode == HttpStatusCode.OK) { SetMessage("Password successfully changed. Please login to your account.", MESSAGE_TYPE.SUCCESS); return RedirectToAction("Login", "Profile", new { Area = "User" }); } else { ModelState.AddModelError("", response.Content); } } } catch (CustomException ex) { ModelState.AddModelError("", ex.Message); } return View(model); }
public ActionResult ResetPassword(string id) { try { if (id == null) { return RedirectToAction("Index", "Home"); } else { var model = new ResetPasswordViewModel() { code = id }; return View(model); } } catch (CustomException ex) { return View("CustomMessage", ex); } }