I am new to jwt, I am trying to generate a token with a secret key, and I pretend that it cannot be decoded without having entered the correct key. I am encoding as follows:
If I enter the page https://jwt.io/ I can decode it correctly without having entered the secret key. why? and how can i fix it?
jwt.sign({ foo: 'bar' }, privateKey, "secret_key", function(err, token) {
console.log(token);
});