B1: React Query deeper adoption (P1–P3) #86

Closed
null wants to merge 340 commits from branch/b1-react-query into main
1 changed files with 2 additions and 2 deletions
Showing only changes of commit f69f778821 - Show all commits

View File

@ -1,6 +1,6 @@
'use strict';
const rateLimit = require('express-rate-limit');
const { rateLimit, ipKeyGenerator } = require('express-rate-limit');
function makeLimiter(max, windowMs, message) {
return rateLimit({
@ -69,7 +69,7 @@ const syncLimiter = rateLimit({
max: 10,
standardHeaders: 'draft-7',
legacyHeaders: false,
keyGenerator: (req) => req.user?.id?.toString() || req.ip,
keyGenerator: (req) => req.user?.id?.toString() || ipKeyGenerator(req),
handler(req, res) {
res.status(429).json({ error: 'Too many sync requests. Please try again in 15 minutes.' });
},