jose
jose copied to clipboard
Implement jwt.isSigned() helper method (or similar)
It would be helpful for various app logic to have a JWT instance method, something like jwt.isSigned()
, to be able to tell whether the jwt has one or multiple signatures (signed), or has alg: 'none'
in the header (unsigned).
For the moment, you have to do something like if (jwt.signature || jwt.signatures)
-- if (jwt.isSigned())
would be more readable.