diff --git a/server/routes/debug.js b/server/routes/debug.js index 10d78ed..fb6a6b2 100644 --- a/server/routes/debug.js +++ b/server/routes/debug.js @@ -27,10 +27,13 @@ router.get('/debug-test', (req, res) => { }); // Get recent detection payloads with raw data -router.get('/detection-payloads', authenticateToken, multiAuth.middleware(), async (req, res) => { +router.get('/detection-payloads', authenticateToken, async (req, res) => { try { const { limit = 50, offset = 0, device_id, detection_id } = req.query; + // Get tenant context for multi-tenant isolation + const tenantId = await multiAuth.determineTenant(req); + const whereClause = { raw_payload: { [Op.ne]: null } }; @@ -83,10 +86,13 @@ router.get('/detection-payloads', authenticateToken, multiAuth.middleware(), asy }); // Get recent heartbeat payloads with raw data -router.get('/heartbeat-payloads', authenticateToken, multiAuth.middleware(), async (req, res) => { +router.get('/heartbeat-payloads', authenticateToken, async (req, res) => { try { const { limit = 50, offset = 0, device_id } = req.query; + // Get tenant context for multi-tenant isolation + const tenantId = await multiAuth.determineTenant(req); + const whereClause = { raw_payload: { [Op.ne]: null } };