Skip to content

Commit

Permalink
Change to Date.now() because it doesn't create a new object
Browse files Browse the repository at this point in the history
  • Loading branch information
timonson committed Jul 20, 2020
1 parent f742488 commit eb970be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function has<K extends string>(
}

function isExpired(exp: number, leeway = 0): boolean {
return exp + leeway < new Date().getTime() / 1000;
return exp + leeway < Date.now() / 1000;
}

// A present 'crit' header parameter indicates that the JWS signature validator
Expand Down

0 comments on commit eb970be

Please sign in to comment.