Fix jwt-token

This commit is contained in:
2025-09-15 09:59:05 +02:00
parent 9e26fd4a0e
commit 43dad665ae

View File

@@ -97,7 +97,9 @@ class MultiTenantAuth {
}
// Method 6: URL path (/tenant2/api/...)
const pathSegments = (req.path || req.url || '').split('/').filter(segment => segment);
const urlPath = req.path || req.url || '';
console.log('🏢 Raw urlPath value:', urlPath);
const pathSegments = urlPath.split('/').filter(segment => segment);
console.log('🏢 URL path segments:', pathSegments, 'from path:', req.path, 'or url:', req.url);
if (pathSegments.length > 0 && pathSegments[0] !== 'api') {
console.log('🏢 Tenant from URL path:', pathSegments[0]);