check isAdmin and auth

This commit is contained in:
Ryan
2025-02-21 20:59:44 -05:00
committed by GitHub
parent b2e37a0b87
commit 5c909acbcb

14
checkAuth.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
session_start();
header('Content-Type: application/json');
if (!isset($_SESSION['authenticated']) || $_SESSION['authenticated'] !== true) {
echo json_encode(["authenticated" => false]);
exit;
}
echo json_encode([
"authenticated" => true,
"isAdmin" => isset($_SESSION["isAdmin"]) ? $_SESSION["isAdmin"] : false
]);
?>