Message from JavaScript discussions

August 2018

— Yes

— 

Hi guys
im tryng to sign a jwt with a private key
but in jwt.io appear invalid signature when i verify
someone can help me please
?

— Where is your secret?

— Also, res.send should be inside the callback

— Privada = my private key

— Is a jwk

— I receive a jwk and after i converted in private key to sign

— When i obtain the sign token in jwt.io appear invalid signature :(

— 

jwt.sign(..., function (err, token) {
res.send({
token
});
});

— Did you try this?

— Putting res.send inside your callback?

— Yes