Expected: malformed tokens of any shape should return
iex(5)> Joken.peek_claims "invalid"
{:error, :token_malformed}
Actuality: if there's dots present, it raises:
Joken.peek_claims "invalid.jwt.token"
** (ErlangError) Erlang error: {:invalid_byte, 143}: invalid byte 16#8F at byte position 0
(stdlib 7.2.1) json.erl:543: :json.invalid_byte/2
(stdlib 7.2.1) json.erl:881: :json.decode/1
(joken 2.6.2) lib/joken.ex:156: Joken.peek_claims/1
iex:5: (file)
Fix: handle this case. Can do a PR if you like
Expected: malformed tokens of any shape should return
Actuality: if there's dots present, it raises:
Fix: handle this case. Can do a PR if you like