diff --git a/server/routes/user.js b/server/routes/user.js index fd6a6a9..c2015f6 100644 --- a/server/routes/user.js +++ b/server/routes/user.js @@ -422,7 +422,9 @@ async function loginLocal(req, res, next) { whereClause[Op.and].push({ tenant_id: null }); } + console.log('🔧 DEBUG: User search whereClause:', JSON.stringify(whereClause, null, 2)); const user = await User.findOne({ where: whereClause }); + console.log('🔧 DEBUG: Found user:', user ? { id: user.id, username: user.username, tenant_id: user.tenant_id } : 'null'); if (!user || !await bcrypt.compare(password, user.password_hash)) { console.log(`❌ Authentication failed for "${username}" in tenant "${req.tenant?.id}"`);