From 97a9ec89986e6d3b6fef7b505f6f052db921b27c Mon Sep 17 00:00:00 2001 From: miunau Date: Thu, 7 Mar 2024 20:24:40 +0100 Subject: [PATCH] 1.5.7 - iat can be same as nbf - Added test for iat being same as nbf --- package.json | 2 +- tests/lib/parse.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index add4b13..4693f4d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "paseto-ts", - "version": "1.5.6", + "version": "1.5.7", "description": "PASETO v4 (encrypt, decrypt, sign & verify) in TypeScript", "type": "module", "keywords": [ diff --git a/tests/lib/parse.ts b/tests/lib/parse.ts index 4ac18fc..3cc6eb3 100644 --- a/tests/lib/parse.ts +++ b/tests/lib/parse.ts @@ -260,6 +260,12 @@ test('parsePayload throws if nbf is before iat', () => { }); }); +test('parsePayload lets a nbf with the same iat through', () => { + assert.ok(() => { + parsePayload({ iat: '2019-01-01T00:00:00Z', nbf: '2019-01-01T00:00:00Z' } as any); + }); +}); + // jti test('it throws if jti claim is not a string', () => {