Add CSRF protections to state-changing endpoints

This commit is contained in:
Ryan
2025-03-18 11:46:23 -04:00
committed by GitHub
parent f709c23bcc
commit d23cefa8a9
23 changed files with 239 additions and 79 deletions

5
token.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
require 'config.php'; // Must call session_start() and generate CSRF token if not set
header('Content-Type: application/json');
echo json_encode(["csrf_token" => $_SESSION['csrf_token']]);
?>