When you sign a key with an empty string as a payload, the verification throws JsonWebTokenError: invalid token. Instead, I expect it to return the empty string, ''. If this can't be accomplished, then I think it should fail to sign with some sort of invalid payload error. I wouldn't expect it to be possible to sign something that cannot be verified.
Description
When you sign a key with an empty string as a payload, the verification throws
JsonWebTokenError: invalid token
. Instead, I expect it to return the empty string,''
. If this can't be accomplished, then I think it should fail to sign with some sort of invalid payload error. I wouldn't expect it to be possible to sign something that cannot be verified.Reproduction
Environment
jsonwebtoken: 8.5.1 node v12.13.0