Fix jwt-token

This commit is contained in:
2025-08-17 09:21:05 +02:00
parent 3c8d5fab9d
commit d23d2dbbce
4 changed files with 311 additions and 94 deletions

View File

@@ -24,11 +24,15 @@ const io = new Server(server, {
}
});
// Rate limiting
// Rate limiting (exclude detections endpoint for testing)
const limiter = rateLimit({
windowMs: parseInt(process.env.RATE_LIMIT_WINDOW_MS) || 15 * 60 * 1000, // 15 minutes
max: parseInt(process.env.RATE_LIMIT_MAX_REQUESTS) || 100,
message: 'Too many requests from this IP, please try again later.'
message: 'Too many requests from this IP, please try again later.',
skip: (req) => {
// Skip rate limiting for drone detection endpoints during testing
return req.path.includes('/detections');
}
});
// Middleware