lib/yammer-oauth2/client.rb in yammer-oauth2-0.3.0 vs lib/yammer-oauth2/client.rb in yammer-oauth2-0.3.1
- old
+ new
@@ -92,15 +92,13 @@
# Content-Type: application/x-www-form-urlencoded
# client_id={client_id}&code=G3Y6jU3a&grant_type=authorization_code&
# redirect_uri=http%3A%2F%2Flocalhost%2Foauth%2Fcb&client_secret={client_secret}
- def exchange_auth_code_for_token(opts={})
- unless (opts[:params] && opts[:params][:code])
- raise ArgumentError.new("You must include an authorization code as a parameter")
- end
+ def exchange_auth_code_for_token(code, opts={})
opts[:authenticate] ||= :body
- code = opts[:params].delete(:code)
+ opts[:params] = {}
+ opts[:params][:redirect_uri] = opts.delete(:redirect_uri)
authorization_code.get_token(code, opts)
end
end
end