I always get invalid signature when I input the generated token in jwt.io Here is my code for making the token
const secret = \'secret\';
const token = jwt.s
If you are using jsonwebtoken lib, I tried and able to create the token and verify as well. Please have a look at the code and let me know in comments if you are still facing the issue.
var jwt = require('jsonwebtoken')
const secret = 'secret';
const token = jwt.sign({
username: "",
userID: 1
},
secret, {
expiresIn: "1hr"
},
function(err, token) {
if (err) {
console.log(err);
} else {
console.log(token);
}
});
Here is the link of jwt.io where I entered your secret used and it's saying verified.
https://jwt.io/#debugger-io?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IiIsInVzZXJJRCI6MSwiaWF0IjoxNTI4NTUyMDYyLCJleHAiOjE1Mjg1NTU2NjJ9.raL79zTGONyXgr9vuXzAyMflHJ0JqPYTXsy9KwmlXhA