public IActionResult Login() { var view = new ViewUserAccountLogin(); CheckForAlerts(); return(View(view)); }
//[ValidateAntiForgeryToken] public ActionResult Login(ViewUserAccountLogin view) { try { if (ModelState.IsValid) { var ListViewUserScreen = JsonConvert.DeserializeObject <ViewUserScreenArea>(GenericRequest(true, "UserAccount", "Authentication", view)); var serialisedDate = JsonConvert.SerializeObject(ListViewUserScreen); //TODO Session to Cookies //There are other ways to login HttpContext.Session.SetString("Token", serialisedDate); return(RedirectToAction("Index", "Home")); } return(View(view)); } catch (Exception ex) { HttpContext.Session.SetString("errorMessage", ex.Message); return(RedirectToAction("Login")); } }