diff --git a/src/EventSubscriber/WebSparkCasSubscriber.php b/src/EventSubscriber/WebSparkCasSubscriber.php index 4279afc..0617910 100644 --- a/src/EventSubscriber/WebSparkCasSubscriber.php +++ b/src/EventSubscriber/WebSparkCasSubscriber.php @@ -15,7 +15,7 @@ class WebSparkCasSubscriber extends CasSubscriber { * {@inheritdoc} */ public function handle(GetResponseEvent $event) { - if ($this->isElasticCrawlerRequest()) { + if ($this->isElasticCrawlerRequest() && !$this->isForcedPath()) { return; } @@ -49,4 +49,18 @@ protected function isElasticCrawlerRequest(): bool { return FALSE; } + /** + * Checks if the path is a forced login one. + * + * @see https://stackoverflow.com/a/61921662 + * + * @return bool + * The check result. + */ + protected function isForcedPath() { + $r = new \ReflectionMethod(parent::class, 'handleForcedPath'); + $r->setAccessible(TRUE); + return $r->invoke($this); + } + }