Class: OmniAuth::Strategies::Twitter
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Twitter
- Defined in:
- lib/j1_app/omniauth/strategies/twitter.rb
Constant Summary collapse
- DEFAULT_SCOPE =
OAuth client settings
'user'
Instance Method Summary collapse
- #callback_path ⇒ Object
- #callback_url ⇒ Object
- #old_callback_url ⇒ Object
- #old_request_phase ⇒ Object
- #raw_info ⇒ Object
- #request_phase ⇒ Object
Instance Method Details
#callback_path ⇒ Object
113 114 115 116 117 118 119 120 121 |
# File 'lib/j1_app/omniauth/strategies/twitter.rb', line 113 def callback_path params = session['omniauth.params'] if params.nil? || params['callback_url'].nil? super else URI(params['callback_url']).path end end |
#callback_url ⇒ Object
105 106 107 108 109 110 111 |
# File 'lib/j1_app/omniauth/strategies/twitter.rb', line 105 def callback_url if request.params['callback_url'] request.params['callback_url'] else old_callback_url end end |
#old_callback_url ⇒ Object
103 |
# File 'lib/j1_app/omniauth/strategies/twitter.rb', line 103 alias :old_callback_url :callback_url |
#old_request_phase ⇒ Object
79 |
# File 'lib/j1_app/omniauth/strategies/twitter.rb', line 79 alias :old_request_phase :request_phase |
#raw_info ⇒ Object
73 74 75 76 77 |
# File 'lib/j1_app/omniauth/strategies/twitter.rb', line 73 def raw_info @raw_info ||= JSON.load(access_token.get('/1.1/account/verify_credentials.json?include_entities=false&skip_status=true&include_email=true').body) rescue ::Errno::ETIMEDOUT raise ::Timeout::Error end |
#request_phase ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/j1_app/omniauth/strategies/twitter.rb', line 81 def request_phase %w[force_login lang screen_name].each do |v| if request.params[v] [:authorize_params][v.to_sym] = request.params[v] end end %w[x_auth_access_type].each do |v| if request.params[v] [:request_params][v.to_sym] = request.params[v] end end if [:use_authorize] || request.params['use_authorize'] == 'true' [:client_options][:authorize_path] = '/oauth/authorize' else [:client_options][:authorize_path] = '/oauth/authenticate' end old_request_phase end |