<?php
require_once 'auth_check.php';
require_once 'db.php';

header('Content-Type: application/json');

try {
    $db = getDB1Connection(); // Assurez-vous que cette fonction retourne la bonne connexion à la base de données
    $query = $db->query("SELECT * FROM identity_verifications ORDER BY created_at DESC");
    $verifications = $query->fetchAll(PDO::FETCH_ASSOC);

    echo json_encode($verifications);
} catch (PDOException $e) {
    http_response_code(500);
    echo json_encode(['error' => 'Database error: ' . $e->getMessage()]);
}
?>
