Closed
Description
Hello guys, I noticed a problem with the doc comment of JWT::decode
method, in the list of what the method throws, DomainException
is missing. This happens for malformed JWT (like the one below).
Also, InvalidArgumentException
is thrown too, even though in a different context.
I'd suggest adding these lines:
* @throws DomainException Provided JWT is malformed
* @throws InvalidArgumentException Provided key is empty
The doc comment makes devs (me 🤷♂️) assume that it is enough to catch the UnexpectedValueException
, which is not true.
Everything works until someone sends in a malformed token.
How to replicate:
JWT::decode(
'foo.bar.qux',
'anything',
['doesntmatter']
);
Would you be interested in a PR instead of an issue?
Metadata
Metadata
Assignees
Labels
No labels