jwtk / njwt

Node.js JWT support
Apache License 2.0
432 stars 49 forks source link

Undocumented - Return in verify #64

Closed fabltd closed 5 years ago

fabltd commented 5 years ago

When verify a JWT the following is returned header body and then:

toString: [Function]

What is the expected operation of toString. There is no mention in the docs.

swiftone commented 5 years ago

Hey @fabltd, thanks for the question:

toString() is just an alias for compact() - it returns the JWT as a Base64 URL-encoded string rather than as a data object. I recommend using compact() for the sake of being explicit.

fabltd commented 5 years ago

Thanks. Suggest adding this to the docs.