From 7286b999fff5625d0768e659016789f7990b55d4 Mon Sep 17 00:00:00 2001 From: Myron Blair Date: Mon, 1 Jun 2026 10:05:37 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20force=20loginScreen=20hidden=20+=20app?= =?UTF-8?q?=20visible=20at=20HTML=20level=20=E2=80=94=20no=20JS=20needed?= =?UTF-8?q?=20to=20show=20dashboard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public_html/index.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/public_html/index.php b/public_html/index.php index 80a7d7e..38bc2e7 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -2,18 +2,38 @@ ini_set('session.cache_limiter', ''); header('Cache-Control: no-store, no-cache, must-revalidate, no-transform'); session_start(); + if (empty($_SESSION['jarvis_token'])) { header('Location: /login.php'); exit; } + $token = $_SESSION['jarvis_token']; $name = $_SESSION['jarvis_name'] ?? ''; $html = file_get_contents(__DIR__ . '/index.html'); -// Inject token as JS globals — no sessionStorage dependency at all + +// 1. Inject token as JS globals — no sessionStorage dependency $inject = ''; -echo str_replace('', '' . $inject, $html); +$html = str_replace('', '' . $inject, $html); + +// 2. Force login screen HIDDEN and app VISIBLE at the HTML level +// so even if JS fails the user sees the dashboard, not the login form +$html = str_replace( + '
', + '
', + $html +); +$html = str_replace( + '
', + '
', + $html +); + +echo $html;