lib/json/jwt.rb in json-jwt-0.0.7 vs lib/json/jwt.rb in json-jwt-0.1.0

- old
+ new

@@ -36,11 +36,11 @@ JWS.new(self).verify(signature_base_string, signature, public_key_or_secret) end end def [](key) - super || with_indifferent_access[key] + super end def to_s [ header.to_json, @@ -56,11 +56,11 @@ raise InvalidFormat.new('Invalid JWT Format. JWT should include 2 dots.') unless jwt_string.count('.') == 2 header, claims, signature = jwt_string.split('.', 3).collect do |segment| UrlSafeBase64.decode64 segment.to_s end signature_base_string = jwt_string.split('.')[0, 2].join('.') - jwt = new JSON.parse(claims) - jwt.header = JSON.parse(header).with_indifferent_access + jwt = new JSON.parse(claims, :symbolize_names => true) + jwt.header = JSON.parse(header, :symbolize_names => true) jwt.verify signature_base_string, signature, public_key_or_secret jwt rescue JSON::ParserError raise InvalidFormat.new("Invalid JSON Format") end