Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix options in OAuth2 strategy to actually allow scope passing.

  • Loading branch information...
commit 5ad7f4a9f863f40b79afba0f0a5fd6e689b6625a 1 parent 4692827
Michael Bleigh mbleigh authored
2  VERSION
View
@@ -1 +1 @@
-0.1.3
+0.1.4
4 oa-oauth/lib/omniauth/strategies/facebook.rb
View
@@ -24,9 +24,9 @@ def user_data
@data ||= MultiJson.decode(@access_token.get('/me'))
end
- def request_phase(options = {})
+ def request_phase
options[:scope] ||= "email,offline_access"
- super(options)
+ super
end
def user_info
4 oa-oauth/lib/omniauth/strategies/gowalla.rb
View
@@ -26,9 +26,9 @@ def user_data
@data ||= MultiJson.decode(@access_token.get("/users/me.json"))
end
- def request_phase(options = {})
+ def request_phase
options[:scope] ||= "email,offline_access"
- super(options)
+ super
end
def user_info
12 oa-oauth/lib/omniauth/strategies/oauth2.rb
View
@@ -8,6 +8,8 @@ module Strategies
class OAuth2
include OmniAuth::Strategy
+ attr_accessor :options, :client
+
class CallbackError < StandardError
attr_accessor :error, :error_reason, :error_uri
@@ -20,15 +22,13 @@ def initialize(error, error_reason=nil, error_uri=nil)
def initialize(app, name, client_id, client_secret, options = {})
super(app, name)
- @options = options
- @client = ::OAuth2::Client.new(client_id, client_secret, options)
+ self.options = options
+ self.client = ::OAuth2::Client.new(client_id, client_secret, options)
end
protected
-
- attr_accessor :client
-
- def request_phase(options = {})
+
+ def request_phase
redirect client.web_server.authorize_url({:redirect_uri => callback_url}.merge(options))
end
Please sign in to comment.
Something went wrong with that request. Please try again.