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.
At the moment
payload
has to be an object but it could have been a primitive type likeString
orNumber
. Besides I think it would better to provideexp
andnbf
as properites ofoptions
argument of theencode
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.