public ActionResult Login(string email, string password) { bool emailAndPasswordAreEmpty = string.IsNullOrWhiteSpace(email) && string.IsNullOrWhiteSpace(password); UserContextModel userContextModel = UsersRepository.ValidatePasswordIsCorrect(email, password); if (userContextModel == null) { ViewBag.ErrorMessages = UsersRepository.ErrorList; return(View("Index")); } else { UserContextHelper.SetUserSession(userContextModel); return(RedirectToAction("Index", "SportEvent")); } }
public ActionResult Logout() { UserContextHelper.SetUserSession(null); return(RedirectToAction("Index")); }