From 93723d4b96c660e500df6abf8eaece255282b90f Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Thu, 18 Sep 2025 06:09:01 +0200 Subject: [PATCH] Fix jwt-token --- server/routes/debug.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 } };