Fix jwt-token
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user