Skip to content

Commit

Permalink
bump oauth2 dependency to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
zokioki committed Dec 29, 2023
1 parent 80840b2 commit 2acdc13
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
UNRELEASED
-----
- BREAKING: Bump `oauth2` dependency to v2.0

0.17.1
------
- Some internal cleanup
Expand Down
2 changes: 1 addition & 1 deletion fitbit_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 1.9.3'

spec.add_runtime_dependency 'oauth2', '~> 1.0'
spec.add_runtime_dependency 'oauth2', '~> 2.0'

spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '~> 3.12'
Expand Down
4 changes: 2 additions & 2 deletions lib/fitbit_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def revoke_token!
headers = default_request_headers.merge(auth_headers)
response = token.post('oauth2/revoke', { headers: headers, body: body }).response

process_keys!(MultiJson.load(response.body))
process_keys!(JSON.parse(response.body))
end

# Performs an authorized GET request to the configured API namespace.
Expand Down Expand Up @@ -173,7 +173,7 @@ def request(verb, path, opts = {}, &block)
refresh_token! if auto_refresh_token && token.expired?

response = token.public_send(verb, request_path, request_options, &block).response
response_body = MultiJson.load(response.body) unless response.status == 204
response_body = JSON.parse(response.body) unless response.status == 204

process_keys!(response_body)
end
Expand Down

0 comments on commit 2acdc13

Please sign in to comment.