lib/omniauth/strategies/linked_in.rb in oa-oauth-0.2.0.beta4 vs lib/omniauth/strategies/linked_in.rb in oa-oauth-0.2.0.beta5
- old
+ new
@@ -3,15 +3,21 @@
module OmniAuth
module Strategies
class LinkedIn < OmniAuth::Strategies::OAuth
def initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block)
- super(app, :linked_in, consumer_key, consumer_secret,
- {:site => 'https://api.linkedin.com',
- :request_token_path => '/uas/oauth/requestToken',
- :access_token_path => '/uas/oauth/accessToken',
- :authorize_path => '/uas/oauth/authorize',
- :scheme => :header}, options, &block)
+ client_options = {
+ :site => 'https://api.linkedin.com',
+ :request_token_path => '/uas/oauth/requestToken',
+ :access_token_path => '/uas/oauth/accessToken',
+ :authorize_path => '/uas/oauth/authorize',
+ :scheme => :header
+ }
+
+ client_options[:authorize_path] = '/uas/oauth/authenticate' unless options[:sign_in] == false
+
+ '/uas/oauth/authorize'
+ super(app, :linked_in, consumer_key, consumer_secret, client_options, options, &block)
end
def auth_hash
hash = user_hash(@access_token)