Fix jwt-token

This commit is contained in:
2025-09-23 15:46:07 +02:00
parent 57e7353d4f
commit c7f4bbbbbd
3 changed files with 229 additions and 2 deletions

View File

@@ -93,6 +93,11 @@ app.use((req, res, next) => ipRestriction.checkIPRestriction(req, res, next));
// Tenant-specific API rate limiting (for authenticated endpoints)
const { enforceApiRateLimit } = require('./middleware/tenant-limits');
app.use('/api', (req, res, next) => {
// Skip tenant rate limiting for management and data-retention endpoints
if (req.path.startsWith('/management') || req.path.startsWith('/data-retention')) {
return next();
}
// Apply tenant rate limiting only to authenticated API endpoints
if (req.headers.authorization) {
return enforceApiRateLimit()(req, res, next);