keycloak
This commit is contained in:
@@ -30,6 +30,11 @@ final class App
|
||||
$apps = AppIconResolver::decorate($registry->all(), $activeSkin);
|
||||
$windows = (new WindowManager($registry))->defaultWindows();
|
||||
$activeWidgetIds = DesktopState::defaultWidgetIds();
|
||||
$isAuthenticated = isset($_SESSION['desktop_auth']) && is_array($_SESSION['desktop_auth']);
|
||||
$authUser = $isAuthenticated && is_array($_SESSION['desktop_auth']['user'] ?? null)
|
||||
? $_SESSION['desktop_auth']['user']
|
||||
: [];
|
||||
$displayName = (string) ($authUser['name'] ?? $authUser['username'] ?? 'Gast');
|
||||
|
||||
return [
|
||||
'meta' => [
|
||||
@@ -45,9 +50,14 @@ final class App
|
||||
'storage_scope' => 'guest',
|
||||
'workspace' => DesktopState::defaultWorkspace(),
|
||||
'login' => [
|
||||
'authenticated' => false,
|
||||
'mode' => 'public-home',
|
||||
'authenticated' => $isAuthenticated,
|
||||
'mode' => $isAuthenticated ? 'authenticated' : 'login-required',
|
||||
'keycloak_theme_handoff' => '/docs/keycloak-theme-handoff.md',
|
||||
'user' => [
|
||||
'name' => (string) ($authUser['name'] ?? ''),
|
||||
'username' => (string) ($authUser['username'] ?? ''),
|
||||
'email' => (string) ($authUser['email'] ?? ''),
|
||||
],
|
||||
],
|
||||
],
|
||||
'apps' => $apps,
|
||||
@@ -58,6 +68,9 @@ final class App
|
||||
'active_ids' => $activeWidgetIds,
|
||||
],
|
||||
'tray' => DesktopState::trayItems(),
|
||||
'session' => [
|
||||
'display_name' => $displayName,
|
||||
],
|
||||
'menu' => [
|
||||
'quick_actions' => DesktopState::quickActions(),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user