From 93ff59e2078d64cf9e010abd7357f88403393839 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Wed, 15 May 2024 13:56:05 +1000 Subject: [PATCH] bug: prevent expiry exception when reading id token claims --- lib/sdk/utilities/token-claims.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sdk/utilities/token-claims.ts b/lib/sdk/utilities/token-claims.ts index 964ca59..e003300 100644 --- a/lib/sdk/utilities/token-claims.ts +++ b/lib/sdk/utilities/token-claims.ts @@ -18,7 +18,7 @@ export const getClaimValue = async ( ): Promise => { const token = (await sessionManager.getSessionItem(`${type}`)) as string; const key = await validationDetails.keyProvider(); - const decodedToken = await jwtVerify(token, key); + const decodedToken = await jwtVerify(token, key, type === 'id_token' ? { currentDate: new Date(0) } : {}); const tokenPayload: Record = decodedToken.payload; return tokenPayload[claim] ?? null; };