Class: OauthController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/generators/connector/templates/oauth_controller.rb

Instance Method Summary collapse

Instance Method Details

#create_omniauthObject



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_omniauthObject



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_omniauthObject

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