Actualiser api/auth.php

This commit is contained in:
2026-07-03 13:52:26 +02:00
parent db203662a5
commit c50029d479
+11
View File
@@ -1,4 +1,15 @@
<?php
// Autoriser les requêtes depuis n'importe quelle origine
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
header("Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With");
// Répondre immédiatement aux requêtes preflight OPTIONS
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit();
}
require_once 'config.php';
$method = $_SERVER['REQUEST_METHOD'];