diff options
Diffstat (limited to 'app/controllers/auth0_controller.rb')
| -rw-r--r-- | app/controllers/auth0_controller.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/controllers/auth0_controller.rb b/app/controllers/auth0_controller.rb new file mode 100644 index 0000000..269727c --- /dev/null +++ b/app/controllers/auth0_controller.rb @@ -0,0 +1,24 @@ +class Auth0Controller < ApplicationController + def callback + session[:userinfo] = request.env['omniauth.auth']['extra']['raw_info'] + + redirect_to '/dashboard' + end + + def failure + @error_msg = request.params['message'] + end + + def logout + reset_session + + redirect_to URI::HTTPS.build( + host: Rails.application.config.auth0['auth0_domain'], + path: '/v2/logout', + query: { + returnTo: root_url, + client_id: Rails.application.config.auth0['auth0_client_id'] + }.to_query + ).to_s + end +end |
