File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11const rateLimit = require ( 'express-rate-limit' ) ;
22
3+ // Skip validation for Azure/reverse proxy environments
4+ const skipValidation = { xForwardedForHeader : false } ;
5+
36// Rate limiter for authentication routes (stricter)
47const authLimiter = rateLimit ( {
58 windowMs : 15 * 60 * 1000 , // 15 minutes
@@ -9,7 +12,8 @@ const authLimiter = rateLimit({
912 message : 'Too many login attempts. Please try again after 15 minutes.'
1013 } ,
1114 standardHeaders : true ,
12- legacyHeaders : false
15+ legacyHeaders : false ,
16+ validate : skipValidation
1317} ) ;
1418
1519// Rate limiter for password reset (very strict)
@@ -21,7 +25,8 @@ const passwordResetLimiter = rateLimit({
2125 message : 'Too many password reset attempts. Please try again after an hour.'
2226 } ,
2327 standardHeaders : true ,
24- legacyHeaders : false
28+ legacyHeaders : false ,
29+ validate : skipValidation
2530} ) ;
2631
2732// General API rate limiter
@@ -33,7 +38,8 @@ const apiLimiter = rateLimit({
3338 message : 'Too many requests. Please slow down.'
3439 } ,
3540 standardHeaders : true ,
36- legacyHeaders : false
41+ legacyHeaders : false ,
42+ validate : skipValidation
3743} ) ;
3844
3945module . exports = {
You can’t perform that action at this time.
0 commit comments