Archived
UserCampusScope relation and audit action; scopeEvent/scopeList/unscopedOnly/ campusIndependent/scopeBroadcast markers; tests/campusScopeRoutes.test.js (still failing: events, payments, registrations, scan locks, tickets left). Can't delete a campus that has scoped staff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
662 B
JavaScript
20 lines
662 B
JavaScript
const express = require('express');
|
|
const rateLimit = require('express-rate-limit');
|
|
const router = express.Router();
|
|
const { trackStage, getFunnel } = require('../controllers/analyticsController');
|
|
const { protect, supervisor } = require('../middleware/authMiddleware');
|
|
const { scopeList } = require('../utils/campusScope');
|
|
|
|
const trackLimiter = rateLimit({
|
|
windowMs: 60 * 1000,
|
|
max: 60,
|
|
standardHeaders: true,
|
|
legacyHeaders: false,
|
|
handler: (req, res) => res.status(204).end(), // silently drop floods
|
|
});
|
|
|
|
router.post('/track', trackLimiter, trackStage);
|
|
router.get('/funnel', protect, supervisor, scopeList, getFunnel);
|
|
|
|
module.exports = router;
|