BUG/MINOR: jwt: Wrong return value checked

The wrong return value was checked, resulting in dead code and
potential bugs.

It should fix GitHub issue #2005.
This patch should be backported up to 2.5.
2 files changed