From 84b711e130bc5ec465fdc688f8a5ce1442cc055d Mon Sep 17 00:00:00 2001 From: Vishal Jain Date: Fri, 24 Jun 2022 18:09:15 +0530 Subject: [PATCH 1/2] redirect disabled user to homepage --- app/controllers/application_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9c22277244..4c590b7792 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -165,8 +165,9 @@ class ApplicationController < ActionController::Base return unless current_spree_user.disabled flash[:success] = nil - flash.now[:error] = I18n.t("devise.failure.disabled") + flash[:error] = I18n.t("devise.failure.disabled") sign_out current_spree_user + redirect_to main_app.root_path end end From 3143cc9d921a49bea1699402f9debcf6e2421459 Mon Sep 17 00:00:00 2001 From: Vishal Jain Date: Tue, 5 Jul 2022 11:35:11 +0530 Subject: [PATCH 2/2] skip disabled user check for session controller --- app/controllers/spree/user_sessions_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/spree/user_sessions_controller.rb b/app/controllers/spree/user_sessions_controller.rb index 798bfc5ff7..c7b4d9bde9 100644 --- a/app/controllers/spree/user_sessions_controller.rb +++ b/app/controllers/spree/user_sessions_controller.rb @@ -16,6 +16,7 @@ module Spree prepend_before_action :handle_unconfirmed_email before_action :set_checkout_redirect, only: :create after_action :ensure_valid_locale_persisted, only: :create + skip_before_action :check_disabled_user def create authenticate_spree_user!