From 0b0f6262b706d97032fda170673f79d85d2258ad Mon Sep 17 00:00:00 2001 From: frederikprijck Date: Thu, 4 Aug 2022 09:59:15 +0200 Subject: [PATCH 1/2] Fix spelling mistakes in id token validation --- src/jwt.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jwt.ts b/src/jwt.ts index e2b9af644..ceea43fa5 100644 --- a/src/jwt.ts +++ b/src/jwt.ts @@ -179,13 +179,13 @@ export const verify = (options: JWTVerifyOptions) => { if (isNumber(decoded.claims.nbf) && now < nbfDate) { throw new Error( - `Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time (${now}) is before ${nbfDate}` + `Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${now}) is before ${nbfDate}` ); } if (isNumber(decoded.claims.auth_time) && now > authTimeDate) { throw new Error( - `Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time (${now}) is after last auth at ${authTimeDate}` + `Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${now}) is after last auth at ${authTimeDate}` ); } From b8f3ad942b3159f9ed48e28527eb20aab59a45c4 Mon Sep 17 00:00:00 2001 From: frederikprijck Date: Thu, 4 Aug 2022 10:03:42 +0200 Subject: [PATCH 2/2] update test --- __tests__/jwt.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/jwt.test.ts b/__tests__/jwt.test.ts index 1dc596c33..2e317fccc 100644 --- a/__tests__/jwt.test.ts +++ b/__tests__/jwt.test.ts @@ -329,7 +329,7 @@ describe('jwt', () => { expect(() => verify({ ...verifyOptions, id_token, max_age: maxAge, leeway }) ).toThrow( - `Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time (${new Date( + `Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${new Date( now )}) is after last auth at ${authTimeDateCorrected}` );