feat: replace fixed login rate limit with progressive lockout
Made-with: Cursor
This commit is contained in:
@@ -6,7 +6,6 @@ import { env } from '../config/env.js';
|
||||
declare module 'fastify' {
|
||||
interface FastifyInstance {
|
||||
rateLimitOptions: {
|
||||
login: { max: number; timeWindow: string };
|
||||
register: { max: number; timeWindow: string };
|
||||
forgotPassword: { max: number; timeWindow: string };
|
||||
verifyEmail: { max: number; timeWindow: string };
|
||||
@@ -18,7 +17,6 @@ declare module 'fastify' {
|
||||
|
||||
const rateLimitPlugin: FastifyPluginAsync = async (app: FastifyInstance) => {
|
||||
const options = {
|
||||
login: { max: env.RATE_LIMIT_LOGIN, timeWindow: '15 minutes' },
|
||||
register: { max: env.RATE_LIMIT_REGISTER, timeWindow: '1 hour' },
|
||||
forgotPassword: { max: env.RATE_LIMIT_FORGOT_PASSWORD, timeWindow: '1 hour' },
|
||||
verifyEmail: { max: env.RATE_LIMIT_VERIFY_EMAIL, timeWindow: '15 minutes' },
|
||||
|
||||
Reference in New Issue
Block a user