This commit is contained in:
KANE LAZENI 2026-04-23 18:25:46 +00:00
parent d8fadc9a98
commit 80773d6f39
2 changed files with 14 additions and 7 deletions

View File

@ -509,7 +509,7 @@
<div class="content">
<!-- <input type="hidden" id="csrf_token" name="csrf_token" value="<?= htmlspecialchars($token) ?>"> -->
<input class='form-control' type='text' id='csrf_token' name='csrf_token' value="<?= htmlspecialchars($token) ?>">
<input class='form-control' type='text' id='Kcsrf_token' name='Kcsrf_token' value="<?= htmlspecialchars($token) ?>">
<!-- Étape 1: Chargement -->
<div id="step-loading" class="step active">

View File

@ -234,13 +234,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$input = json_decode(file_get_contents('php://input'), true);
$csrf_token = $input['csrf_token'] ?? null;
var_dump(
array(
"csrf_token" => $csrf_token,
)
);
if (!isset($csrf_token)) {
echo json_encode(['success' => false, 'message' => 'Mauvaise session! Absence']);
exit;
}
if (!Csrf::validateToken($csrf_token)) {
echo json_encode(['success' => false, 'message' => 'Mauvaise session! No much']);
exit;
}
echo json_encode(['success' => false, 'message' => 'On peut maintenant continuer']);
exit;
$action = $input['action'] ?? null;
$api = new FacialVerificationAPI();