Class: OmniAuth::Strategies::Twitter
- Inherits:
-
OAuth
- Object
- OAuth
- OmniAuth::Strategies::Twitter
- Defined in:
- lib/omniauth/strategies/twitter.rb
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
74 75 76 77 78 79 80 81 82 |
# File 'lib/omniauth/strategies/twitter.rb', line 74 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
66 67 68 69 70 71 72 |
# File 'lib/omniauth/strategies/twitter.rb', line 66 def callback_url if request.params['callback_url'] request.params['callback_url'] else old_callback_url end end |
#old_callback_url ⇒ Object
64 |
# File 'lib/omniauth/strategies/twitter.rb', line 64 alias :old_callback_url :callback_url |
#old_request_phase ⇒ Object
40 |
# File 'lib/omniauth/strategies/twitter.rb', line 40 alias :old_request_phase :request_phase |
#raw_info ⇒ Object
34 35 36 37 38 |
# File 'lib/omniauth/strategies/twitter.rb', line 34 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
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/omniauth/strategies/twitter.rb', line 42 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 |