Class: DeviseG5Authenticatable::SessionsController
- Inherits:
-
Devise::OmniauthCallbacksController
- Object
- Devise::OmniauthCallbacksController
- DeviseG5Authenticatable::SessionsController
- Defined in:
- app/controllers/devise_g5_authenticatable/sessions_controller.rb
Overview
Custom sessions controller to require sign-in through the G5 auth server
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/controllers/devise_g5_authenticatable/sessions_controller.rb', line 16 def create if sign_in_or_register else params = { restricted: base_url } redirect_to(restricted_application_redirect_url + '?' + params.to_query) end end |
#destroy ⇒ Object
25 26 27 28 29 |
# File 'app/controllers/devise_g5_authenticatable/sessions_controller.rb', line 25 def destroy signed_in_resource.try(:revoke_g5_credentials!) local_sign_out remote_sign_out end |
#new ⇒ Object
8 9 10 |
# File 'app/controllers/devise_g5_authenticatable/sessions_controller.rb', line 8 def new redirect_to (resource_name) end |
#omniauth_passthru ⇒ Object
12 13 14 |
# File 'app/controllers/devise_g5_authenticatable/sessions_controller.rb', line 12 def omniauth_passthru render status: 404, plain: 'Authentication passthru.' end |