diff --git a/lib/jwt/decode.rb b/lib/jwt/decode.rb index 6282e946..c44f755f 100644 --- a/lib/jwt/decode.rb +++ b/lib/jwt/decode.rb @@ -92,8 +92,8 @@ def signing_input end def parse_and_decode(segment) - JSON.parse(JWT::Base64.url_decode(segment)) - rescue JSON::ParserError + JWT::JSON.parse(JWT::Base64.url_decode(segment)) + rescue ::JSON::ParserError raise JWT::DecodeError, 'Invalid segment encoding' end end