Ejemplo n.º 1
0
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            base.OnActionExecuting(context);

            if (string.IsNullOrEmpty(HttpContext.Session.GetString(SessionUserDetails)) ||
                string.IsNullOrEmpty(HttpContext.Session.GetString(SessionToken)))
            {
                return;
            }

            LoggedUser = new LoggedUserModel(HttpContext.Session.GetString(SessionUserDetails), HttpContext.Session.GetString(SessionToken));

            if (LoggedUser != null)
            {
                ViewData.Add("apps", _getUserApps.Invoke(LoggedUser.UserModel.Id));
            }

            loggedUserSessionService.AddItem(LoggedUser);
        }