diff --git a/api/lab/_helpers.php b/api/lab/_helpers.php index 038501b..4e87577 100644 --- a/api/lab/_helpers.php +++ b/api/lab/_helpers.php @@ -48,6 +48,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') { requireAuthentication(); +/** + * Shorthand para obtener la conexión PDO. + */ +function db(): \PDO { + return Database::getInstance()->getConnection(); +} + /** * ID del admin autenticado actualmente. */ diff --git a/api/lab/check_whatsapp.php b/api/lab/check_whatsapp.php index 9029105..7dc1ad8 100644 --- a/api/lab/check_whatsapp.php +++ b/api/lab/check_whatsapp.php @@ -4,7 +4,7 @@ * Verifica si un número de teléfono está registrado en WhatsApp (tabla users). */ require_once __DIR__ . '/_helpers.php'; -requireAuth(); +// requireAuthentication() ya fue llamado por _helpers.php $phone = trim($_GET['phone'] ?? ''); if (!$phone) { jsonError('phone requerido', 400); }