From 42f9693d0032b5e165568f89d4bf611016a88955 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 5 Jan 2023 13:40:27 +0100 Subject: [PATCH] Fix PermalinkRedirector not applying to users with moved accounts (#22497) Fixes #22262 --- app/controllers/concerns/web_app_controller_concern.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/concerns/web_app_controller_concern.rb b/app/controllers/concerns/web_app_controller_concern.rb index c671ce785..cbd522246 100644 --- a/app/controllers/concerns/web_app_controller_concern.rb +++ b/app/controllers/concerns/web_app_controller_concern.rb @@ -4,7 +4,7 @@ module WebAppControllerConcern extend ActiveSupport::Concern included do - before_action :redirect_unauthenticated_to_permalinks! + prepend_before_action :redirect_unauthenticated_to_permalinks! before_action :set_app_body_class before_action :set_referrer_policy_header end @@ -18,7 +18,7 @@ module WebAppControllerConcern end def redirect_unauthenticated_to_permalinks! - return if user_signed_in? + return if user_signed_in? && current_account.moved_to_account_id.nil? redirect_path = PermalinkRedirector.new(request.path).redirect_path