Adjust audience e add log env

This commit is contained in:
LeoMortari
2025-09-15 01:49:11 -03:00
parent 77777f0aab
commit a5708cb7c9
2 changed files with 3 additions and 3 deletions

View File

@@ -13,9 +13,8 @@ export class KeycloakAuthGuard extends AuthGuard('jwt') {
info: unknown,
context: import('@nestjs/common').ExecutionContext,
): TUser {
this.logger.log(`User: ${JSON.stringify(user)}`);
this.logger.log(`Error: ${JSON.stringify(err)}`);
this.logger.log(`Info: ${JSON.stringify(info)}`);
this.logger.log(`KEYCLOAK_URL: ${process.env.KEYCLOAK_URL}`);
this.logger.log(`NODE_ENV: ${process.env.NODE_ENV}`);
if (err || !user) {
if (err instanceof UnauthorizedException) {

View File

@@ -45,6 +45,7 @@ export class KeycloakJwtStrategy extends PassportStrategy(Strategy, 'jwt') {
}),
algorithms: ['RS256'],
issuer: `${baseUrl}/realms/clipperia`,
audience: 'account',
ignoreExpiration: false,
});
}