Skip to content

Commit

Permalink
Merge pull request #2 from ASUWebPlatforms/WS2-1205-3
Browse files Browse the repository at this point in the history
WS2-1205: Respect the CAS "forced login" settings.
  • Loading branch information
mlsamuelson authored Feb 7, 2022
2 parents 0a78f82 + 519e05c commit 728016a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/EventSubscriber/WebSparkCasSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class WebSparkCasSubscriber extends CasSubscriber {
* {@inheritdoc}
*/
public function handle(GetResponseEvent $event) {
if ($this->isElasticCrawlerRequest()) {
if ($this->isElasticCrawlerRequest() && !$this->isForcedPath()) {
return;
}

Expand Down Expand Up @@ -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);
}

}

0 comments on commit 728016a

Please sign in to comment.