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());
        }
Example #2
0
 public void Logout()
 {
     WebSecurity.Logout();
     UserSessionData.Empty();
 }