Adjust audience e add log env
This commit is contained in:
@@ -13,9 +13,8 @@ export class KeycloakAuthGuard extends AuthGuard('jwt') {
|
|||||||
info: unknown,
|
info: unknown,
|
||||||
context: import('@nestjs/common').ExecutionContext,
|
context: import('@nestjs/common').ExecutionContext,
|
||||||
): TUser {
|
): TUser {
|
||||||
this.logger.log(`User: ${JSON.stringify(user)}`);
|
this.logger.log(`KEYCLOAK_URL: ${process.env.KEYCLOAK_URL}`);
|
||||||
this.logger.log(`Error: ${JSON.stringify(err)}`);
|
this.logger.log(`NODE_ENV: ${process.env.NODE_ENV}`);
|
||||||
this.logger.log(`Info: ${JSON.stringify(info)}`);
|
|
||||||
|
|
||||||
if (err || !user) {
|
if (err || !user) {
|
||||||
if (err instanceof UnauthorizedException) {
|
if (err instanceof UnauthorizedException) {
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ export class KeycloakJwtStrategy extends PassportStrategy(Strategy, 'jwt') {
|
|||||||
}),
|
}),
|
||||||
algorithms: ['RS256'],
|
algorithms: ['RS256'],
|
||||||
issuer: `${baseUrl}/realms/clipperia`,
|
issuer: `${baseUrl}/realms/clipperia`,
|
||||||
|
audience: 'account',
|
||||||
ignoreExpiration: false,
|
ignoreExpiration: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user