diff --git a/server/routes/user.js b/server/routes/user.js index 76f3665..4f3424b 100644 --- a/server/routes/user.js +++ b/server/routes/user.js @@ -387,8 +387,10 @@ async function loginLocal(req, res, next) { // Get tenant information from request (set by multi-tenant auth middleware) let tenantId = null; if (req.tenant && req.tenant.id) { + console.log('🔧 DEBUG: Looking for tenant with slug:', req.tenant.id); // Find the actual tenant in database const tenant = await Tenant.findOne({ where: { slug: req.tenant.id } }); + console.log('🔧 DEBUG: Found tenant:', tenant ? { id: tenant.id, slug: tenant.slug } : 'null'); if (tenant) { tenantId = tenant.id; }