40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/omniauth/strategies/twitter.rb', line 40
def request_phase
force_login = session['omniauth.params'] ? session['omniauth.params']['force_login'] : nil
screen_name = session['omniauth.params'] ? session['omniauth.params']['screen_name'] : nil
x_auth_access_type = session['omniauth.params'] ? session['omniauth.params']['x_auth_access_type'] : nil
if force_login && !force_login.empty?
options[:authorize_params] ||= {}
options[:authorize_params].merge!(:force_login => 'true')
end
if screen_name && !screen_name.empty?
options[:authorize_params] ||= {}
options[:authorize_params].merge!(:screen_name => screen_name)
end
if x_auth_access_type
options[:request_params] ||= {}
options[:request_params].merge!(:x_auth_access_type => x_auth_access_type)
end
if session['omniauth.params'] && session['omniauth.params']["use_authorize"] == "true"
options.client_options.authorize_path = '/oauth/authorize'
else
options.client_options.authorize_path = '/oauth/authenticate'
end
old_request_phase
end
|