visual
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user