refactor(auth): expose verifyAccessToken (was private validateJwtToken)

Co-Authored-By: WOZCODE <contact@withwoz.com>
This commit is contained in:
Rafael
2026-08-20 10:06:02 -03:00
co-authored by WOZCODE
parent 1730ec2753
commit 15b5c49fb2
+7 -2
View File
@@ -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');