class JWT::Decode

def parse_and_decode(segment)

def parse_and_decode(segment)
  JWT::JSON.parse(::JWT::Base64.url_decode(segment))
rescue ::JSON::ParserError
  raise JWT::DecodeError, 'Invalid segment encoding'
end