Files
desktop/public/auth/logout/index.php
Lars Gebhardt-Kusche 84a367bdc9
All checks were successful
Deploy / deploy-staging (push) Successful in 23s
Deploy / deploy-production (push) Has been skipped
adasd
2026-06-15 23:38:30 +02:00

29 lines
516 B
PHP

<?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()) {
$logoutUrl = $auth->logoutUrl();
}
$auth->logout();
if ($logoutUrl !== null) {
header('Location: ' . $logoutUrl, true, 302);
exit;
}
header('Location: /auth/keycloak', true, 302);
exit;