Fix jwt-token
This commit is contained in:
@@ -226,6 +226,9 @@ router.get('/debug', authenticateToken, async (req, res) => {
|
||||
include: [{
|
||||
model: Device,
|
||||
as: 'device',
|
||||
where: {
|
||||
tenant_id: req.user.tenant_id // 🔒 SECURITY: Filter by user's tenant
|
||||
},
|
||||
attributes: ['id', 'name', 'location_description', 'geo_lat', 'geo_lon', 'tenant_id']
|
||||
}],
|
||||
limit: parseInt(limit),
|
||||
@@ -243,6 +246,8 @@ router.get('/debug', authenticateToken, async (req, res) => {
|
||||
};
|
||||
});
|
||||
|
||||
console.log(`🔒 Admin debug: Retrieved ${detections.count} detections for tenant ${req.user.tenant_id}`);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
data: enhancedDetections,
|
||||
|
||||
Reference in New Issue
Block a user