mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat(rate-limiting): implement rate limiting for login attempts and enhance configuration
- Added environment variables for `RATE_LIMIT_MAX_FAILED_ATTEMPTS` and `RATE_LIMIT_LOCKOUT_TIME` - Integrated rate limiting into the login process with a maximum of 5 failed attempts - Refactored login attempt recording into the `authRouter` - Removed deprecated `recordLogin` middleware and adjusted related logic
This commit is contained in:
1 parent
bda68ad293
commit
ccbc4ff4b0
9 files changed
+49
-51
No files matched your search
@@ -68,6 +68,13 @@ function createConfig() {
|
||||
trustedProxies: getTrustProxies('TRUSTED_PROXIES'),
|
||||
surveyUrl: getUrl('SURVEY_URL'),
|
||||
bugReportUrl: getUrl('BUG_REPORT_URL'),
|
||||
rateLimit: {
|
||||
maxFailedAttempts: Number(
|
||||
process.env.RATE_LIMIT_MAX_FAILED_ATTEMPTS ?? 5
|
||||
),
|
||||
lockoutTime:
|
||||
Number(process.env.RATE_LIMIT_LOCKOUT_TIME ?? 10) * 60 * 1000,
|
||||
},
|
||||
|
||||
projectRoot,
|
||||
|
||||
|
||||
Reference in new issue
Block a user