Class: Capcoauth::LoginController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Capcoauth::LoginController
- Defined in:
- app/controllers/capcoauth/login_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
#capcoauth_token, #oauth_callback_url
Instance Method Details
#show ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/capcoauth/login_controller.rb', line 5 def show # If set in session if session[:capcoauth_access_token] # Attempt to verify begin capcoauth_token.verify if Capcoauth.configuration.perform_login_redirects redirect_to session.delete(:previous_url) || root_url, notice: 'You are already logged in' else redirect_to root_url, notice: 'You are already logged in' end return rescue; end end # Otherwise, redirect redirect_to "#{Capcoauth.configuration.capcoauth_url}/oauth/authorize?client_id=#{Capcoauth.configuration.client_id}&redirect_uri=#{URI.encode(oauth_callback_url)}&response_type=code" end |