From 6866acda891c9a2b39b961030c06bf744ae2a5f2 Mon Sep 17 00:00:00 2001 From: LeoMortari Date: Mon, 15 Sep 2025 01:35:11 -0300 Subject: [PATCH] add logs --- src/auth/keycloak-auth.guard.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/auth/keycloak-auth.guard.ts b/src/auth/keycloak-auth.guard.ts index 5aba027..1c3650e 100644 --- a/src/auth/keycloak-auth.guard.ts +++ b/src/auth/keycloak-auth.guard.ts @@ -1,11 +1,16 @@ -import { Injectable, UnauthorizedException } from '@nestjs/common'; +import { Injectable, Logger, UnauthorizedException } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; import type { JwtPayload } from './keycloak.strategy'; @Injectable() export class KeycloakAuthGuard extends AuthGuard('jwt') { + private readonly logger = new Logger(KeycloakAuthGuard.name); + handleRequest(err: any, user: JwtPayload): TUser { + this.logger.log('KeycloakAuthGuard.handleRequest'); + console.log(user); + console.log(err); if (err || !user) { if (err instanceof UnauthorizedException) { throw err;