added authorize_params to monkeypatch in google strategy

This commit is contained in:
Phil Spitler 2011-10-18 14:20:13 -04:00
Родитель 2447925e11
Коммит d403418b50
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -59,9 +59,12 @@ module OmniAuth
@user_hash ||= MultiJson.decode(@access_token.get('https://www.google.com/m8/feeds/contacts/default/full?max-results=1&alt=json').body)
end
# Monkeypatch OmniAuth to pass the scope in the consumer.get_request_token call
# Monkeypatch OmniAuth to pass the scope and authorize_params in the consumer.get_request_token call
def request_phase
request_token = consumer.get_request_token({:oauth_callback => callback_url}, {:scope => options[:scope]})
request_options = {:scope => options[:scope]}
request_options.merge!(options[:authorize_params])
request_token = consumer.get_request_token({:oauth_callback => callback_url}, request_options)
session['oauth'] ||= {}
session['oauth'][name.to_s] = {'callback_confirmed' => request_token.callback_confirmed?, 'request_token' => request_token.token, 'request_secret' => request_token.secret}
r = Rack::Response.new