Skip to content

Commit

Permalink
[SDK-3538] Fix spelling mistakes in id token validation (#940)
Browse files Browse the repository at this point in the history
* Fix spelling mistakes in id token validation

* update test
  • Loading branch information
frederikprijck authored Aug 5, 2022
1 parent 3b0ebc3 commit 91c5be3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion __tests__/jwt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
);
Expand Down
4 changes: 2 additions & 2 deletions src/jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
);
}

Expand Down

0 comments on commit 91c5be3

Please sign in to comment.