<?php
require_once __DIR__.'/_auth.php';
if($_SERVER['REQUEST_METHOD']!=='POST')jsonResponse(['ok'=>false,'erro'=>'Método não permitido.'],405);
$admin=afAdminApiUser($pdo);$raw=bearerToken();$pdo->prepare('UPDATE af_admin_sessions SET revogada_em=NOW() WHERE token_hash=?')->execute([hash('sha256',$raw)]);afAdminAccessLog($pdo,(int)$admin['id'],'api_logout',true);jsonResponse(['ok'=>true]);
