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:
Mrugesh Mohapatra
2023-02-10 18:43:54 +05:30
committed by GitHub
parent 0f4fd9d57b
commit ffc97f15d1

View File

@@ -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
})