mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
fix: PHP entry point with Cache-Control: no-transform — disables Rocket Loader; server-side auth redirect
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user