diff --git a/Contestation/Demandereconnaissancefaciale.php b/Contestation/Demandereconnaissancefaciale.php index 2e6d4f9..47b5e0a 100755 --- a/Contestation/Demandereconnaissancefaciale.php +++ b/Contestation/Demandereconnaissancefaciale.php @@ -567,6 +567,7 @@ validateToken(); }; + /* function validateToken() { fetch('verify_facial_api.php', { method: 'POST', @@ -592,6 +593,34 @@ showError('KANE : Erreur de connexion au serveur'); }); } + */ + + function validateToken() { + $.ajax({ + url: 'verify_facial_api.php', + method: 'POST', + contentType: 'application/json', + data: JSON.stringify({ + action: 'validate_token', + token: verificationToken + }), + dataType: 'json', + success: function(data) { + alert("succes => " + data); + console.log('Réponse JSON :', data); + if (data.success) { + showStep('step-instructions'); + } else { + showError(data.message || 'Lien expiré ou invalide'); + } + }, + error: function() { + alert("Error => " + data); + showError('KANE : Erreur de connexion au serveur'); + } + }); + } + function showStep(stepId) { document.querySelectorAll('.step').forEach(step => { diff --git a/Contestation/verify_facial_api.php b/Contestation/verify_facial_api.php index 852f7d3..ffe27f8 100644 --- a/Contestation/verify_facial_api.php +++ b/Contestation/verify_facial_api.php @@ -1,4 +1,4 @@ -