hokaccha / node-jwt-simple

JWT(JSON Web Token) encode and decode module for node.js
MIT License
1.36k stars 136 forks source link

Expires On (exp) and Not Before (nbf) should be properties of options instead of payload. #80

Closed kedicesur closed 6 years ago

kedicesur commented 6 years ago

At the moment payload has to be an object but it could have been a primitive type like String or Number. Besides I think it would better to provide exp and nbf as properites of options argument of the encode function which would yield them to reside in the header of the JWT. This change might yield breaking of the previous versions but I think it is worthwhile.