adadsa
This commit is contained in:
@@ -12,9 +12,14 @@ session_start();
|
||||
$projectRoot = dirname(__DIR__, 3);
|
||||
$auth = new KeycloakAuth(ConfigLoader::load($projectRoot, 'keycloak'));
|
||||
$logoutUrl = null;
|
||||
$target = trim((string) ($_GET['target'] ?? '/auth/keycloak'));
|
||||
|
||||
if ($target === '' || !str_starts_with($target, '/')) {
|
||||
$target = '/auth/keycloak';
|
||||
}
|
||||
|
||||
if ($auth->isConfigured()) {
|
||||
$logoutUrl = $auth->logoutUrl();
|
||||
$logoutUrl = $auth->logoutUrl($target);
|
||||
}
|
||||
|
||||
$auth->logout();
|
||||
@@ -24,5 +29,5 @@ if ($logoutUrl !== null) {
|
||||
exit;
|
||||
}
|
||||
|
||||
header('Location: /auth/keycloak', true, 302);
|
||||
header('Location: ' . $target, true, 302);
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user