Clarifying Questions (and Answers!) :-)
nelsonic opened this issue · 1 comments
nelsonic commented
nelsonic commented
Yes, you need to have the jsonwebtoken module in your node_modules so that you can sign tokens in your application.
Your validateFunction only validates if the JWT sent by the client is valid, in order to _create_ new JWTs in your application you need to have jsonwebtoken.
npm install jsonwebtoken --save
then you can simply var JWT = require('jsonwebtoken')
above your jwtSign
method and use it as described in the docs.
If unclear, please see: https://github.com/docdis/learn-json-web-tokens
for an example signing method see our "Real World Example" section in the Readme.
Thanks for the great question! 👍