From 91c5be375fd66f8d971b94547a79d27d349c2e96 Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Fri, 5 Aug 2022 11:08:13 +0200 Subject: [PATCH] [SDK-3538] Fix spelling mistakes in id token validation (#940) * Fix spelling mistakes in id token validation * update test --- __tests__/jwt.test.ts | 2 +- src/jwt.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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}` ); 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}` ); }