public async Task <IActionResult> Login(string Username, string Password) { var user = Logic.FindUser(Username, Password); if (user != null) { await RegisterCookieForUser(user); return(RedirectToAction("Index", "Home")); } ViewBag.Error = "Username or Password are incorrect"; return(View()); }