120
rated 0 times
[
127]
[
7]
/ answers: 1 / hits: 30595
/ 7 Years ago, thu, may 11, 2017, 12:00:00
bearer = bearerHeader.replace(Bearer,);
jwt.verify(bearer, 'super_secret', function (err, decoded) {
console.log(err);
console.log(decoded);
});
Here is my code. Whenever I try to verify Token. I want to replace Bearer from header to verify only token. it will always goes to 'err' if a take Bearer. when i remove the Bearer from header i will work perfect. anyone please help me to solve this. Is there any way to solve this problem?
Output:
{
[JsonWebTokenError: invalid token] name: 'JsonWebTokenError',
message: 'invalid token'
}
undefined
More From » node.js