Class: OauthController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- OauthController
- Defined in:
- lib/generators/connector/templates/oauth_controller.rb
Instance Method Summary collapse
- #create_omniauth ⇒ Object
- #destroy_omniauth ⇒ Object
-
#request_omniauth ⇒ Object
TODO Routes for this controller are not provided by the gem and should be set according to your needs.
Instance Method Details
#create_omniauth ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/generators/connector/templates/oauth_controller.rb', line 16 def create_omniauth return redirect_to root_url unless is_admin # TODO # Update current_organization with oauth params # Should at least set oauth_uid, oauth_token and oauth_provider end |
#destroy_omniauth ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/generators/connector/templates/oauth_controller.rb', line 24 def destroy_omniauth return redirect_to root_url unless is_admin current_organization.clear_omniauth redirect_to root_url end |
#request_omniauth ⇒ Object
TODO Routes for this controller are not provided by the gem and should be set according to your needs
7 8 9 10 11 12 13 14 |
# File 'lib/generators/connector/templates/oauth_controller.rb', line 7 def request_omniauth return redirect_to root_url unless is_admin # TODO # Perform oauth request here. The oauth process should be able to # remember the organization, either by a param in the request or using # a session end |