Module: ColorgyDeviseSSOManager

Extended by:
ActiveSupport::Concern
Defined in:
app/controllers/concerns/colorgy_devise_sso_manager.rb

Constant Summary collapse

@@sst_verification_method =
'RS256'
@@sso_enabled =
true

Instance Method Summary collapse

Instance Method Details

#logout_urlObject



24
25
26
# File 'app/controllers/concerns/colorgy_devise_sso_manager.rb', line 24

def logout_url
  sign_out_url
end

#sign_out_if_neededObject

Sign the user out if needed



29
30
31
32
# File 'app/controllers/concerns/colorgy_devise_sso_manager.rb', line 29

def sign_out_if_needed
  return unless !@@sso_enabled && params[:logout] == 'true'
  sign_out :user
end

#sign_out_urlObject

Helper to get the core sign-out URL



16
17
18
19
20
21
22
# File 'app/controllers/concerns/colorgy_devise_sso_manager.rb', line 16

def sign_out_url
  if @@sso_enabled
    "#{core_url}/logout"
  else
    "#{root_path}?logout=true"
  end
end

#sso_off!Object

Turn off SSO



35
36
37
# File 'app/controllers/concerns/colorgy_devise_sso_manager.rb', line 35

def sso_off!
  @@sso_enabled = false
end