Skip to content

Commit 93ff59e

Browse files
committed
bug: prevent expiry exception when reading id token claims
1 parent 264baaa commit 93ff59e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/sdk/utilities/token-claims.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const getClaimValue = async (
1818
): Promise<unknown | null> => {
1919
const token = (await sessionManager.getSessionItem(`${type}`)) as string;
2020
const key = await validationDetails.keyProvider();
21-
const decodedToken = await jwtVerify(token, key);
21+
const decodedToken = await jwtVerify(token, key, type === 'id_token' ? { currentDate: new Date(0) } : {});
2222
const tokenPayload: Record<string, unknown> = decodedToken.payload;
2323
return tokenPayload[claim] ?? null;
2424
};

0 commit comments

Comments
 (0)