diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index b50aacc43..5da9aaab6 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -68,15 +68,6 @@ class Users::SessionsController < Devise::SessionsController flash[:system_notification_modal] = true end - protected - - def remove_authenticate_mesasge_if_root_path - if session[:user_return_to] == root_path && flash[:alert] == I18n.t('devise.failure.unauthenticated') - flash[:alert] = nil - end - end - - private def authenticate_with_two_factor user = User.find_by(id: session[:otp_user_id]) @@ -120,6 +111,14 @@ class Users::SessionsController < Devise::SessionsController end + private + + def remove_authenticate_mesasge_if_root_path + if session[:user_return_to] == root_path && flash[:alert] == I18n.t('devise.failure.unauthenticated') + flash[:alert] = nil + end + end + def redirect_2fa user = User.find_by(email: params[:user][:email])