()
| 118 | }; |
| 119 | |
| 120 | export const buildAuthRateLimit = () => { |
| 121 | const context = buildRateLimitContext(); |
| 122 | const generator = buildKeyGenerator(); |
| 123 | |
| 124 | return rateLimit({ |
| 125 | max: env.AUTH_RATE_LIMIT_MAX, |
| 126 | duration: env.AUTH_RATE_LIMIT_WINDOW_MS, |
| 127 | scoping: "scoped", |
| 128 | countFailedRequest: true, |
| 129 | ...(context !== undefined && { context }), |
| 130 | ...(generator !== undefined && { generator }), |
| 131 | }); |
| 132 | }; |
no test coverage detected