From b994c5a108ade2f0d2235b7018c0fca0cc8b0421 Mon Sep 17 00:00:00 2001 From: Alu-card19 Date: Tue, 30 Jun 2026 07:26:30 +0100 Subject: [PATCH] fix: replace console.error with Nest Logger in rate-limit.guard.ts --- src/auth/guards/rate-limit.guard.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/auth/guards/rate-limit.guard.ts b/src/auth/guards/rate-limit.guard.ts index 5fc996a4..9001d6dc 100644 --- a/src/auth/guards/rate-limit.guard.ts +++ b/src/auth/guards/rate-limit.guard.ts @@ -7,6 +7,7 @@ import { HttpException, HttpStatus, Inject, + Logger, } from '@nestjs/common'; import { Reflector } from '@nestjs/core'; import { RateLimitService } from '../rate-limit.service'; @@ -31,6 +32,8 @@ export const CustomRateLimit = (options: { @Injectable() export class RateLimitGuard implements CanActivate { + private readonly logger = new Logger(RateLimitGuard.name); + constructor( private reflector: Reflector, @Inject(RateLimitService) private rateLimitService: RateLimitService, @@ -141,7 +144,7 @@ export class RateLimitGuard implements CanActivate { throw error; } // If rate limit check fails, allow the request - console.error('Rate limit check error:', error); + this.logger.error('Rate limit check error', error instanceof Error ? error.stack : String(error)); return true; } }