Skip to content

Commit

Permalink
add missing decode in legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan committed Apr 21, 2024
1 parent cd2ae57 commit 63022c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/legacy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ describe("JWT legacy", () => {
assert.strictEqual(typeof jwt, "string", "JWT should be a string");
});

await t.test("Decode JWT", async () => {
const decoded = JWT.decode(jwt);
assert.deepStrictEqual(
decoded,
{ ...message, iat: decoded.iat },
"Decoded message should match the original"
);
});

await t.test("Verify JWT", async () => {
try {
const verified = JWT.verify(jwt, keyPair.publicKey, {
Expand Down

0 comments on commit 63022c5

Please sign in to comment.