Skip to content

Commit f399b3a

Browse files
committed
let faraday encode params
1 parent caddab6 commit f399b3a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

lib/rack/oauth2.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def self.debug(&block)
4242

4343
def self.http_client(agent_name = "Rack::OAuth2 (#{VERSION})", &local_http_config)
4444
Faraday.new(headers: {user_agent: agent_name}) do |faraday|
45+
faraday.request :json
46+
faraday.request :url_encoded
4547
faraday.response :logger, Rack::OAuth2.logger if debugging?
4648
faraday.adapter Faraday.default_adapter
4749
local_http_config&.call(faraday)

lib/rack/oauth2/client.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ def access_token!(*args)
7474
params.merge! @grant.as_json
7575
params.merge! options
7676
handle_response do
77-
http_client.post(
78-
absolute_uri_for(token_endpoint),
79-
Util.compact_hash(params).to_query,
80-
headers
81-
)
77+
http_client.post(absolute_uri_for(token_endpoint), Util.compact_hash(params), headers)
8278
end
8379
end
8480

0 commit comments

Comments
 (0)