Fix jwt-token
This commit is contained in:
@@ -422,7 +422,9 @@ async function loginLocal(req, res, next) {
|
|||||||
whereClause[Op.and].push({ tenant_id: null });
|
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 });
|
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)) {
|
if (!user || !await bcrypt.compare(password, user.password_hash)) {
|
||||||
console.log(`❌ Authentication failed for "${username}" in tenant "${req.tenant?.id}"`);
|
console.log(`❌ Authentication failed for "${username}" in tenant "${req.tenant?.id}"`);
|
||||||
|
|||||||
Reference in New Issue
Block a user