Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/auth/guards/rate-limit.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
HttpException,
HttpStatus,
Inject,
Logger,
} from '@nestjs/common';
import { Reflector } from '@nestjs/core';
import { RateLimitService } from '../rate-limit.service';
Expand All @@ -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,
Expand Down Expand Up @@ -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;
}
}
Expand Down
Loading