Skip to content

Commit c7c3208

Browse files
committed
fix issue where empty string for LOGIN_REQUEST_THROTTLER_LIMIT and LOGIN_REQUEST_THROTTLER_TTL causes test failure
1 parent ada8624 commit c7c3208

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/api/src/core/decorators/throttle-login-request.decorator.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ import { DEFAULT_LOGIN_REQUEST_THROTTLER_LIMIT, DEFAULT_LOGIN_REQUEST_THROTTLER_
1010
const LOGIN_REQUEST_THROTTLER_LIMIT = $NumberLike
1111
.pipe(z.number().int().positive())
1212
.default(DEFAULT_LOGIN_REQUEST_THROTTLER_LIMIT)
13-
.parse(process.env.LOGIN_REQUEST_THROTTLER_LIMIT);
13+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
14+
.parse(process.env.LOGIN_REQUEST_THROTTLER_LIMIT || undefined);
1415

1516
const LOGIN_REQUEST_THROTTLER_TTL = $NumberLike
1617
.pipe(z.number().int().positive())
1718
.default(DEFAULT_LOGIN_REQUEST_THROTTLER_TTL)
18-
.parse(process.env.LOGIN_REQUEST_THROTTLER_TTL);
19+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
20+
.parse(process.env.LOGIN_REQUEST_THROTTLER_TTL || undefined);
1921

2022
export function ThrottleLoginRequest() {
2123
return applyDecorators(

0 commit comments

Comments
 (0)