public ActionResult ResetPassword(UserViewModel user) { int userRole = 0; try { authHandler.ResetPasswordData(user); userRole = authHandler.GetUserRole(user.Email); ViewData["SuccessMessage"] = "Password change successfully, please login to proceed"; } catch (UserNotCreatedException ex) { Logger.Logger.WriteLog(Logger.Logtype.Error, ex.Message, user.UserId, typeof(AuthController), ex); ModelState.AddModelError("ErrorMessage", string.Format("{0}", ex.Message)); } if (userRole == 1) { return(View("AdminLogin")); } else if (userRole == 2) { return(View("JobSeekerLogin")); } else { return(View("EmployerLogin")); } }