keycloak
This commit is contained in:
@@ -5,8 +5,35 @@ declare(strict_types=1);
|
||||
require_once dirname(__DIR__) . '/src/App/bootstrap.php';
|
||||
|
||||
use App\App;
|
||||
use App\ConfigLoader;
|
||||
use App\KeycloakAuth;
|
||||
|
||||
$app = new App(dirname(__DIR__));
|
||||
session_start();
|
||||
|
||||
$projectRoot = dirname(__DIR__);
|
||||
$keycloakConfig = ConfigLoader::load($projectRoot, 'keycloak');
|
||||
$auth = new KeycloakAuth($keycloakConfig);
|
||||
|
||||
if (!$auth->shouldShowDesktop()) {
|
||||
$previewUrl = null;
|
||||
|
||||
if ($auth->allowDesktopPreview()) {
|
||||
$previewUrl = '/?' . urlencode($auth->previewQueryKey()) . '=1';
|
||||
}
|
||||
|
||||
$loginScreen = [
|
||||
'branding' => $auth->branding(),
|
||||
'login_url' => $auth->isConfigured() ? '/auth/keycloak' : null,
|
||||
'preview_url' => $previewUrl,
|
||||
'keycloak_ready' => $auth->isConfigured(),
|
||||
'callback_url' => $auth->redirectUri(),
|
||||
];
|
||||
|
||||
require $projectRoot . '/partials/auth/login_screen.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
$app = new App($projectRoot);
|
||||
$desktopPayload = $app->desktopPayload();
|
||||
|
||||
require dirname(__DIR__) . '/partials/desktop/shell.php';
|
||||
require $projectRoot . '/partials/desktop/shell.php';
|
||||
|
||||
Reference in New Issue
Block a user