Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: mov now where used
Browse files Browse the repository at this point in the history
ilteoood committed Nov 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent e895a87 commit bdc18b4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/verifier.js
Original file line number Diff line number Diff line change
@@ -191,9 +191,6 @@ function verifyToken(
throw new TokenError(TokenError.codes.invalidType, 'Invalid typ.')
}

// Verify the payload
const now = clockTimestamp || Date.now()

if (requiredClaims) {
for (const claim of requiredClaims) {
if (!(claim in payload)) {
@@ -218,6 +215,8 @@ function verifyToken(
validateClaimType(values, claim, array, type === 'date' ? 'number' : 'string')

if (type === 'date') {
// Verify the payload
const now = clockTimestamp || Date.now()
validateClaimDateValue(value, modifier, now, greater, errorCode, errorVerb)
} else {
validateClaimValues(values, claim, allowed, arrayValue)

0 comments on commit bdc18b4

Please sign in to comment.