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