FIX: Improve error message when login_required sites are under load

FIX: Improve error message when login_required sites are under load

Previously a confusing message would pop up making private communities thing that anonymous access is granted.

diff --git a/app/assets/javascripts/discourse/app/components/global-notice.js b/app/assets/javascripts/discourse/app/components/global-notice.js
index c6a2e9e..9dc041b 100644
--- a/app/assets/javascripts/discourse/app/components/global-notice.js
+++ b/app/assets/javascripts/discourse/app/components/global-notice.js
@@ -72,7 +72,9 @@ export default Component.extend({
         removeCookie("dosp", { path: "/" });
         notices.push(
           Notice.create({
-            text: I18n.t("forced_anonymous"),
+            text: this.siteSettings.login_required
+              ? I18n.t("forced_anonymous_login_required")
+              : I18n.t("forced_anonymous"),
             id: "forced-anonymous",
           })
         );
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 3d10088..a603f2f 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -3634,6 +3634,7 @@ en:
       custom_message_template_topic: "Hey, I thought you might enjoy this topic!"
 
     forced_anonymous: "Due to extreme load, this is temporarily being shown to everyone as a logged out user would see it."
+    forced_anonymous_login_required: "The site is under extreme load and cannot be loaded at this time, try again in a few minutes."
 
     footer_nav:
       back: "Back"

GitHub sha: 845987ce

1 Like

This commit appears in #12170 which was approved by eviltrout. It was merged by SamSaffron.