Skip to content

Commit

Permalink
Merge pull request #61 from kinde-oss/leo/id_expiry
Browse files Browse the repository at this point in the history
bug: prevent expiry exception when reading id token claims
  • Loading branch information
DanielRivers authored May 15, 2024
2 parents 264baaa + 93ff59e commit 2b2a26d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sdk/utilities/token-claims.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const getClaimValue = async (
): Promise<unknown | null> => {
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<string, unknown> = decodedToken.payload;
return tokenPayload[claim] ?? null;
};
Expand Down

0 comments on commit 2b2a26d

Please sign in to comment.