Created
June 9, 2020 17:33
-
-
Save fedeagripa/dbcc29097f3e4c2d0b75c36a16af3c6e to your computer and use it in GitHub Desktop.
2fa_session_controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controllers/admin_users/sessions_controller.rb | |
module AdminUsers | |
class SessionsController < Devise::SessionsController | |
# As you are overwriting devise session controller you need this to allow to login with user & pass (dev mode) | |
prepend_before_action :require_no_authentication, only: [:new, :create] | |
layout 'active_admin_logged_out' | |
helper ::ActiveAdmin::ViewHelpers | |
def new | |
unless Rails.env.development? || Rails.env.test? | |
return redirect_to :new_saml_admin_user_session | |
end | |
super | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment