Skip to content

Commit

Permalink
Clear template cache when authenticating OIDC usr
Browse files Browse the repository at this point in the history
Address OIDC authentication issue where cached menu templates are not
refreshed on login.

When a user's groups are updated in the identity provider, this fix
ensures that the main menu icons are updated to show all admin functions.
  • Loading branch information
sbreker committed Jun 28, 2024
1 parent 375dbd5 commit bd0952d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/arOidcPlugin/lib/oidcUser.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ public function authenticate($username = null, $password = null): bool
}

$authenticated = true;

// Clear template cache.
$cacheClear = new sfCacheClearTask(sfContext::getInstance()->getEventDispatcher(), new sfFormatter());
$cacheClear->run([], ['type' => 'template']);

// Refresh user so new groups and credentials are immediately available on signIn().
$this->signIn(QubitUser::getById($user->id));
}
Expand Down

0 comments on commit bd0952d

Please sign in to comment.