Skip to content

Commit

Permalink
Move setRedirectUrl() logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sbreker committed Oct 10, 2024
1 parent 1fb6ee1 commit 18135ad
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
12 changes: 6 additions & 6 deletions plugins/arOidcPlugin/lib/arOidc.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public static function getOidcInstance()
{
$oidc = new OpenIDConnectClient();

// Validate redirect URL.
$redirectUrl = sfConfig::get('app_oidc_redirect_url', '');
if (empty($redirectUrl)) {
throw new Exception('Invalid OIDC redirect URL. Please review the app_oidc_redirect_url parameter in plugin app.yml.');
}
$oidc->setRedirectURL($redirectUrl);
// // Validate redirect URL.
// $redirectUrl = sfConfig::get('app_oidc_redirect_url', '');
// if (empty($redirectUrl)) {
// throw new Exception('Invalid OIDC redirect URL. Please review the app_oidc_redirect_url parameter in plugin app.yml.');
// }
// $oidc->setRedirectURL($redirectUrl);

return $oidc;
}
Expand Down
13 changes: 11 additions & 2 deletions plugins/arOidcPlugin/lib/oidcUser.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,18 @@ public function initialize(sfEventDispatcher $dispatcher, sfStorage $storage, $o

parent::initialize($dispatcher, $storage, $options);

if (null === $this->oidcClient) {
$this->setOidcClient(arOidc::getOidcInstance());
$this->setOidcClient(arOidc::getOidcInstance());

$this->setRedirectURL();
}

public function setRedirectUrl()
{
$redirectUrl = sfConfig::get('app_oidc_redirect_url', '');
if (empty($redirectUrl)) {
throw new Exception('Invalid OIDC redirect URL. Please review the app_oidc_redirect_url parameter in plugin app.yml.');
}
$this->oidcClient->setRedirectURL($redirectUrl);
}

/**
Expand Down

0 comments on commit 18135ad

Please sign in to comment.