fix(api): agregar db() helper, corregir requireAuth() en check_whatsapp
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
92e4d01181
commit
9e7637582d
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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); }
|
||||
|
||||
Reference in New Issue
Block a user