From 46a40074bd8e2e90080bfec6f035e090d998edad Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Sun, 14 Sep 2025 17:52:18 +0200 Subject: [PATCH] Fix jwt-token --- server/middleware/ip-restriction.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/server/middleware/ip-restriction.js b/server/middleware/ip-restriction.js index 4cd879d..d4afd11 100644 --- a/server/middleware/ip-restriction.js +++ b/server/middleware/ip-restriction.js @@ -166,16 +166,21 @@ class IPRestrictionMiddleware { } // Get tenant configuration - const tenant = await Tenant.findOne({ where: { slug: tenantId } }); + const tenant = await Tenant.findOne({ + where: { slug: tenantId }, + attributes: ['id', 'slug', 'ip_restriction_enabled', 'ip_whitelist', 'ip_restriction_message', 'updated_at'] + }); if (!tenant) { console.log('🔍 IP Restriction - Tenant not found in database:', tenantId); return next(); } - console.log('🔍 IP Restriction - Tenant config:', { + console.log('🔍 IP Restriction - Tenant config (fresh from DB):', { + id: tenant.id, slug: tenant.slug, ip_restriction_enabled: tenant.ip_restriction_enabled, - ip_whitelist: tenant.ip_whitelist + ip_whitelist: tenant.ip_whitelist, + updated_at: tenant.updated_at }); // Check if IP restrictions are enabled