The JWT guide here - https://scotch.io/tutorials/the-anatomy-of-a-json-web-token#header - says they run base64url
on this:
{
"typ": "JWT",
"alg": "HS256"
}
And they end up with this:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
I try this code:
var b64u = require("base64url")
var rez = b64u(JSON.stringify({
"typ": "JWT",
"alg": "HS256"
}));
var shouldbe = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9';
console.log(rez);
console.log(shouldbe);
console.log(rez == shouldbe);
as seen here in online test: https://tonicdev.com/56c5484d7a4ea10d0002c623/5733af59234d9d1200d8c818
however they are not matching.
Does anyone see any simple issue?