File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ export const DEFAULT_LOGIN_REQUEST_THROTTLER_LIMIT = 50 ;
2+
3+ export const DEFAULT_LOGIN_REQUEST_THROTTLER_TTL = 60_000 ;
Original file line number Diff line number Diff line change @@ -3,16 +3,18 @@ import { applyDecorators } from '@nestjs/common';
33import { Throttle } from '@nestjs/throttler' ;
44import z from 'zod/v4' ;
55
6+ import { DEFAULT_LOGIN_REQUEST_THROTTLER_LIMIT , DEFAULT_LOGIN_REQUEST_THROTTLER_TTL } from '../constants' ;
7+
68// we cannot inject the config service here, so this needs to be parsed manually
79
810const LOGIN_REQUEST_THROTTLER_LIMIT = $NumberLike
911 . pipe ( z . number ( ) . int ( ) . positive ( ) )
10- . default ( 50 )
12+ . default ( DEFAULT_LOGIN_REQUEST_THROTTLER_LIMIT )
1113 . parse ( process . env . LOGIN_REQUEST_THROTTLER_LIMIT ) ;
1214
1315const LOGIN_REQUEST_THROTTLER_TTL = $NumberLike
1416 . pipe ( z . number ( ) . int ( ) . positive ( ) )
15- . default ( 60_000 )
17+ . default ( DEFAULT_LOGIN_REQUEST_THROTTLER_TTL )
1618 . parse ( process . env . LOGIN_REQUEST_THROTTLER_TTL ) ;
1719
1820export function ThrottleLoginRequest ( ) {
You can’t perform that action at this time.
0 commit comments