<?php



require_once __DIR__ . '/../config.php';

// POST /admin/logout.php
// Header: Authorization: Bearer <token>

$admin = requireAdmin();

$db = getDB();
$stmt = $db->prepare('DELETE FROM admin_sessions WHERE token = ?');
$token = getAdminToken();
$stmt->execute([$token]);

jsonOk(['message' => 'Sesión cerrada.'], 200);
