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

This commit is contained in:
2026-08-14 01:24:24 +02:00
parent 97e5a2e2da
commit 6de12f164d
5 changed files with 201 additions and 18 deletions

View File

@@ -14,8 +14,9 @@ final class ModuleHttp
{
$auth = new KeycloakAuth(ConfigLoader::load($projectRoot, 'keycloak'));
$accountGate = new AccountGate(ConfigLoader::load($projectRoot, 'registration'));
$hasAuthenticatedSession = $auth->ensureAuthenticatedSession();
if ($auth->isAuthenticated()) {
if ($hasAuthenticatedSession) {
$currentUser = is_array($_SESSION['desktop_auth']['user'] ?? null) ? $_SESSION['desktop_auth']['user'] : [];
$accountCheck = $accountGate->checkUsername((string) ($currentUser['username'] ?? ''));
@@ -35,7 +36,7 @@ final class ModuleHttp
}
}
if (!$auth->shouldShowDesktop()) {
if (!$hasAuthenticatedSession && !$auth->shouldShowDesktop()) {
if ($json) {
self::respondJson(['error' => 'Nicht autorisiert.'], 401);
}