Fix jwt-token
This commit is contained in:
@@ -7,6 +7,7 @@ const MultiTenantAuth = require('../middleware/multi-tenant-auth');
|
|||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
const logger = new ApiDebugLogger();
|
const logger = new ApiDebugLogger();
|
||||||
|
const multiAuth = new MultiTenantAuth();
|
||||||
|
|
||||||
// Test endpoint for API debugging
|
// Test endpoint for API debugging
|
||||||
router.get('/debug-test', (req, res) => {
|
router.get('/debug-test', (req, res) => {
|
||||||
@@ -26,7 +27,7 @@ router.get('/debug-test', (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Get recent detection payloads with raw data
|
// Get recent detection payloads with raw data
|
||||||
router.get('/detection-payloads', authenticateToken, MultiTenantAuth, async (req, res) => {
|
router.get('/detection-payloads', authenticateToken, multiAuth.middleware(), async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { limit = 50, offset = 0, device_id, detection_id } = req.query;
|
const { limit = 50, offset = 0, device_id, detection_id } = req.query;
|
||||||
|
|
||||||
@@ -82,7 +83,7 @@ router.get('/detection-payloads', authenticateToken, MultiTenantAuth, async (req
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Get recent heartbeat payloads with raw data
|
// Get recent heartbeat payloads with raw data
|
||||||
router.get('/heartbeat-payloads', authenticateToken, MultiTenantAuth, async (req, res) => {
|
router.get('/heartbeat-payloads', authenticateToken, multiAuth.middleware(), async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { limit = 50, offset = 0, device_id } = req.query;
|
const { limit = 50, offset = 0, device_id } = req.query;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user