From 15b5c49fb23606fc2fe7e4a2770356ca61a915f1 Mon Sep 17 00:00:00 2001 From: Rafael Date: Thu, 20 Aug 2026 10:06:02 -0300 Subject: [PATCH] refactor(auth): expose verifyAccessToken (was private validateJwtToken) Co-Authored-By: WOZCODE --- src/modules/auth/auth.service.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/auth/auth.service.ts b/src/modules/auth/auth.service.ts index 8539d0e..8ca6844 100644 --- a/src/modules/auth/auth.service.ts +++ b/src/modules/auth/auth.service.ts @@ -307,7 +307,7 @@ export class AuthClientService implements OnModuleInit { } public async validateUserSession(accessToken: any, resourceHost: string) { - const payload = await this.validateJwtToken(accessToken); + const payload = await this.verifyAccessToken(accessToken); const userDto = await this.getUserfromPayload(payload); @@ -410,7 +410,12 @@ export class AuthClientService implements OnModuleInit { this.logger.info('Clean cookie sessions'); } - private async validateJwtToken(token: string) { + /** + * Verify a DUC access token against the JWKS and return its payload. + * Public so the /auth/module-identity route can authenticate the ddf-auth + * cookie the same way (was the private validateJwtToken). + */ + public async verifyAccessToken(token: string) { const decoded: any = token && jwt.decode(token, { complete: true }); if (!decoded) throw new Error('Invalid token');