keycloak
All checks were successful
Deploy / deploy-staging (push) Successful in 46s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-06-08 02:45:36 +02:00
parent 6d398323ae
commit 1ae7b98378
14 changed files with 1036 additions and 4 deletions

View File

@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
require_once dirname(__DIR__, 3) . '/src/App/bootstrap.php';
use App\ConfigLoader;
use App\KeycloakAuth;
session_start();
$projectRoot = dirname(__DIR__, 3);
$auth = new KeycloakAuth(ConfigLoader::load($projectRoot, 'keycloak'));
$logoutUrl = null;
if ($auth->isConfigured() && $auth->isAuthenticated()) {
$logoutUrl = $auth->logoutUrl();
}
$auth->logout();
if ($logoutUrl !== null) {
header('Location: ' . $logoutUrl, true, 302);
exit;
}
header('Location: /auth/login', true, 302);
exit;