dispatcher->dispatchTyped(new BeforeLoginTemplateRenderedEvent($response)); } else { $isLoggedIn = !($response instanceof StandaloneTemplateResponse) && $this->userSession->isLoggedIn(); $this->dispatcher->dispatchTyped(new BeforeTemplateRenderedEvent($isLoggedIn, $response)); } } return $response; } }