Skip to content

Commit f98168b

Browse files
nbf should be allowed to be equal to iat
1 parent 72c5fe0 commit f98168b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/parse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export function parsePayload(payload: string | Payload | Uint8Array, {
289289
throw new PasetoClaimInvalid("Payload must have a valid \"nbf\" claim (is not an date or a valid relative time string (e.g. \"1 hour\"))");
290290
}
291291
// The "nbf" claim must be greater than the "iat" claim
292-
if (obj.hasOwnProperty("iat") && nbf <= Date.parse((obj as any).iat)) {
292+
if (obj.hasOwnProperty("iat") && nbf < Date.parse((obj as any).iat)) {
293293
throw new PasetoClaimInvalid("Payload must have a valid \"nbf\" claim (is not greater than \"iat\")");
294294
}
295295
// The "nbf" claim must not be in the future
@@ -385,4 +385,4 @@ export function deriveEncryptionAndAuthKeys(key: Uint8Array, nonce: Uint8Array)
385385
counterNonce,
386386
authKey,
387387
}
388-
}
388+
}

0 commit comments

Comments
 (0)