Class: TwitterConnectsController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- TwitterConnectsController
- Includes:
- TwitterOauth
- Defined in:
- lib/app/controllers/twitter_connects_controller.rb
Instance Attribute Summary
Attributes inherited from ActionController::Base
Instance Method Summary collapse
Methods included from TwitterOauth
Methods inherited from ActionController::Base
Instance Method Details
#callback ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/app/controllers/twitter_connects_controller.rb', line 16 def callback oauth = get_oauth oauth.(session[:rtoken], session[:rsecret], params[:oauth_verifier]) session[:rtoken] = nil session[:rsecret] = nil session[:atoken] = oauth.access_token.token session[:asecret] = oauth.access_token.secret render :file => File.dirname(__FILE__) + '/../views/twitter_connects/callback.html.erb' end |
#logout ⇒ Object
26 27 28 29 30 31 |
# File 'lib/app/controllers/twitter_connects_controller.rb', line 26 def logout session[:atoken] = nil session[:asecret] = nil redirect_to TwitterConnect.configuration['logout_url'] || root_url end |
#oauth ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/app/controllers/twitter_connects_controller.rb', line 7 def oauth oauth = get_oauth request_token = oauth.set_callback_url twitter_callback_url session[:rtoken] = request_token.token session[:rsecret] = request_token.secret redirect_to request_token. end |