From c9888187f6f7bf13d8bbd1e5c6e1c16436cfffbd Mon Sep 17 00:00:00 2001 From: marsalva Date: Sat, 14 Mar 2026 17:14:32 +0000 Subject: [PATCH] Actualizar server.js --- server.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 6cc084f..35227fb 100644 --- a/server.js +++ b/server.js @@ -930,8 +930,11 @@ app.post("/public/auth/request-otp", async (req, res) => { // Enviar el WhatsApp const msg = `🔐 Tu código de acceso para solicitar asistencia es: *${code}*\n\nSi no has solicitado este código, ignora este mensaje.`; - sendWhatsAppAuto("34" + cleanPhone, msg, `cliente_${targetOwnerId}`, false).catch(console.error); - + + // Usar la instancia global de la configuración web (ej. ADMIN) + const instanceName = process.env.EVOLUTION_INSTANCE || `cliente_${targetOwnerId}`; + sendWhatsAppAuto("34" + cleanPhone, msg, instanceName, false).catch(console.error); + res.json({ ok: true }); } catch(e) { console.error("Error OTP Request:", e);