fix: PHP entry point with Cache-Control: no-transform — disables Rocket Loader; server-side auth redirect

This commit is contained in:
2026-06-01 09:39:03 +00:00
parent f30f0fdfad
commit 06a5b92543
3 changed files with 106 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
<?php
ini_set('session.cache_limiter', '');
header('Cache-Control: no-store, no-cache, must-revalidate, no-transform');
session_name('jarvis_main');
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 = '<script>sessionStorage.setItem("jarvis_token",' . json_encode($token)
. ');sessionStorage.setItem("jarvis_user",' . json_encode($name) . ');</script>';
echo str_replace('<head>', '<head>' . $inject, $html);