<?php
require_once __DIR__ . '/../includes/bootstrap.php';

$payload = require_admin($config);

$stmt = $pdo->prepare('SELECT id, email FROM admin_users WHERE id = ? LIMIT 1');
$stmt->execute([$payload['sub']]);
$admin = $stmt->fetch();

if (!$admin) json_error('Sesión inválida.', 401);

json_ok(['user' => $admin]);
