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

This commit is contained in:
2026-06-17 21:04:59 +02:00
parent 29b5987aac
commit dbb317927a
5 changed files with 65 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ require_once dirname(__DIR__) . '/src/App/bootstrap.php';
use App\App;
use App\AccountGate;
use App\AuthStatusRedirect;
use App\ConfigLoader;
use App\KeycloakAuth;
@@ -17,6 +18,15 @@ $registrationConfig = ConfigLoader::load($projectRoot, 'registration');
$auth = new KeycloakAuth($keycloakConfig);
$accountGate = new AccountGate($registrationConfig);
if (!$auth->isAuthenticated()) {
$statusRedirect = AuthStatusRedirect::consume();
if ($statusRedirect !== null) {
header('Location: ' . $statusRedirect, true, 302);
exit;
}
}
if ($auth->isAuthenticated()) {
$currentUser = is_array($_SESSION['desktop_auth']['user'] ?? null) ? $_SESSION['desktop_auth']['user'] : [];
$accountCheck = $accountGate->checkUsername((string) ($currentUser['username'] ?? ''));