Actualiser api/auth.php

This commit is contained in:
2026-07-03 20:28:37 +02:00
parent 9ecb154c36
commit 2fa7e47737
-13
View File
@@ -1,18 +1,5 @@
<?php
// ==========================================
// 1. GESTION CORS (À METTRE TOUT EN HAUT)
// ==========================================
// Autoriser les requêtes depuis n'importe quelle origine (ou remplacez * par http://localhost)
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 du navigateur
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit(); // On arrête le script ici pour l'OPTIONS
}
// ==========================================
require_once 'config.php';