Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
2fa_session_controller
# 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
You can’t perform that action at this time.