I have the following header:
authorization: 'JWT kjf838.token.8383bfjefjh'
When I try to verify the token I get a invalid token error:
var token = req.headers['authorization'];
jwt.verify(token, config.secret, function (err, decoded) {...}
Do I have to remove the JWT-prefix on my own?
That's correct. Try with this:
var token = req.headers['authorization'].replace(/^JWT\s/, '');
Most helpful comment
That's correct. Try with this: