mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-07 18:03:49 -05:00
fix(api): update mobile-auth ratelimit config (#49194)
* fix(api): use proper name for collection * fix(api): use the x-forwarded-for ip address
This commit is contained in:
committed by
GitHub
parent
0f4fd9d57b
commit
ffc97f15d1
@@ -11,7 +11,11 @@ export default function rateLimitMiddleware() {
|
||||
max: 10,
|
||||
standardHeaders: true,
|
||||
legacyHeaders: false,
|
||||
keyGenerator: req => {
|
||||
return req.headers['x-forwarded-for'] || 'localhost';
|
||||
},
|
||||
store: new MongoStore({
|
||||
collectionName: 'UserRateLimit',
|
||||
uri: url,
|
||||
expireTimeMs: 15 * 60 * 1000
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user