From 99147e99558ed79fa3be380bb6828c4962c6c146 Mon Sep 17 00:00:00 2001 From: marsalva Date: Sun, 8 Mar 2026 20:29:18 +0000 Subject: [PATCH] Actualizar server.js --- server.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/server.js b/server.js index 0360d1d..f80fa3b 100644 --- a/server.js +++ b/server.js @@ -424,8 +424,6 @@ function extractValidPhone(rawPhone) { const digits = str.replace(/\D/g, ""); // Si falla, coge los primeros 9 nĂºmeros que pille return digits.length >= 9 ? digits.substring(0, 9) : digits; } -function normalizePhone(phone) { let p = String(phone || "").trim().replace(/\s+/g, "").replace(/-/g, ""); if (!p) return ""; if (!p.startsWith("+") && /^[6789]\d{8}/.test(p)) return "+34" + p; return p; } - function normalizePhone(phone) { let p = String(phone || "").trim().replace(/\s+/g, "").replace(/-/g, ""); if (!p) return ""; if (!p.startsWith("+") && /^[6789]\d{8}/.test(p)) return "+34" + p; return p; } function signToken(user) { const accountId = user.owner_id || user.id; return jwt.sign({ sub: user.id, email: user.email, phone: user.phone, role: user.role || 'operario', accountId }, JWT_SECRET, { expiresIn: "30d" }); }