public ActionResult Index() { // Logout if user is banned var user = _userService.GetById(WebSecurity.CurrentUserId); if (user.IsBanned) { WebSecurity.Logout(); UserSessionData.Empty(); return(RedirectToAction("Index", "Home")); } return(View()); }
public void Logout() { WebSecurity.Logout(); UserSessionData.Empty(); }