Closed MilosStanic closed 9 years ago
thanks, I think I solved my problem. Not very happily, but solved it :)
Hey @MilosStanic, I just published v2.0.0 of jws
which should fix your problem. I changed the default encoding from binary
to utf8
and added an option to override the default.
Hi @brianloveswords, thanks. I kinda solved my problem by escaping utf-8 chars before encoding them, and unescaping them after. But let's see how jws 2.0.0 works out when it gets adopted in the jsonwebtoken
Your library is used by node-jsonwebtoken, and when it signs the token using your library it seems that it breaks the payload if there is an UTF8 character in the payload. When I retrieve the token and decode it, and when I parse with JSON.parse() I get 'Unexpected token' error if the payload contained UTF8 chars. In my case it was char 'ć' . Can you verify?