Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
2fa_session_controller_devise_patch
# app/controllers/admin_users/sessions_controller.rb
prepend_before_action :require_no_authentication, only: [:new, :create]
prepend_before_action :allow_params_authentication!, only: :create
prepend_before_action :verify_signed_out_user, only: :destroy
prepend_before_action(only: [:create, :destroy]) { request.env["devise.skip_timeout"] = true }
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.