FIX: show sign up modal when local logins are disabled (#12611)

FIX: show sign up modal when local logins are disabled (#12611)

diff --git a/app/assets/javascripts/discourse/app/controllers/create-account.js b/app/assets/javascripts/discourse/app/controllers/create-account.js
index adbebd4..6dc0fa3 100644
--- a/app/assets/javascripts/discourse/app/controllers/create-account.js
+++ b/app/assets/javascripts/discourse/app/controllers/create-account.js
@@ -97,6 +97,9 @@ export default Controller.extend(
       if (hasAtLeastOneLoginButton && !hasAuthOptions) {
         classes.push("has-alt-auth");
       }
+      if (!this.canCreateLocal) {
+        classes.push("no-local-logins");
+      }
       return classes.join(" ");
     },
 
diff --git a/app/assets/javascripts/discourse/app/templates/modal/create-account.hbs b/app/assets/javascripts/discourse/app/templates/modal/create-account.hbs
index fc5ccc8..2e20650 100644
--- a/app/assets/javascripts/discourse/app/templates/modal/create-account.hbs
+++ b/app/assets/javascripts/discourse/app/templates/modal/create-account.hbs
@@ -7,17 +7,18 @@
         {{loading-spinner size="large"}}
       {{/if}}
 
-      {{#if showCreateForm}}
-        <div class="create-account-form">
-          <div class="login-welcome-header">
-            <h1 class="login-title">{{i18n "create_account.header_title"}}</h1> <img src={{wavingHandURL}} alt="" class="waving-hand">
-            <p class="login-subheader">{{i18n "create_account.subheader_title"}}</p>
+      <div class="create-account-form">
+        <div class="login-welcome-header">
+          <h1 class="login-title">{{i18n "create_account.header_title"}}</h1> <img src={{wavingHandURL}} alt="" class="waving-hand">
+          <p class="login-subheader">{{i18n "create_account.subheader_title"}}</p>
+        </div>
+        {{#unless hasAuthOptions}}
+          <div class="create-account-login-buttons">
+            {{login-buttons externalLogin=(action "externalLogin")}}
           </div>
-          {{#unless hasAuthOptions}}
-            <div class="create-account-login-buttons">
-              {{login-buttons externalLogin=(action "externalLogin")}}
-            </div>
-          {{/unless}}
+        {{/unless}}
+        {{#if showCreateForm}}
+
           <div class="login-form">
 
             <form>
@@ -147,29 +148,29 @@
               {{/if}}
             </form>
           </div>
-          {{#if showCreateForm}}
-            <div class="modal-footer">
-              {{d-button
-                class="btn-large btn-primary"
-                action=(action "createAccount")
-                disabled=submitDisabled
-                label="create_account.title"
-                isLoading=formSubmitted
-              }}
-
-              {{#unless hasAuthOptions}}
-                {{d-button class="btn-large" id="login-link" action=(route-action "showLogin") disabled=formSubmitted label="log_in"}}
-              {{/unless}}
 
-              <div class="disclaimer">
-                {{html-safe disclaimerHtml}}
-              </div>
+          <div class="modal-footer">
+            {{d-button
+              class="btn-large btn-primary"
+              action=(action "createAccount")
+              disabled=submitDisabled
+              label="create_account.title"
+              isLoading=formSubmitted
+            }}
+
+            {{#unless hasAuthOptions}}
+              {{d-button class="btn-large" id="login-link" action=(route-action "showLogin") disabled=formSubmitted label="log_in"}}
+            {{/unless}}
+
+            <div class="disclaimer">
+              {{html-safe disclaimerHtml}}
             </div>
+          </div>
 
-            {{plugin-outlet name="create-account-after-modal-footer" tagName=""}}
-          {{/if}}
-        </div>
-      {{/if}}
+          {{plugin-outlet name="create-account-after-modal-footer" tagName=""}}
+
+        {{/if}}
+      </div>
     {{/d-modal-body}}
   {{/unless}}
 {{/create-account}}
diff --git a/app/assets/stylesheets/common/base/login.scss b/app/assets/stylesheets/common/base/login.scss
index 085bc0f..7eb3537 100644
--- a/app/assets/stylesheets/common/base/login.scss
+++ b/app/assets/stylesheets/common/base/login.scss
@@ -105,6 +105,14 @@
   &.awaiting-approval {
     display: none;
   }
+
+  .no-local-logins {
+    // when third-party auth is available, but not local logins
+    .login-left-side,
+    .login-welcome-header {
+      padding: 3em 1em 3em 3em;
+    }
+  }
 }
 
 // Login Form Styles

GitHub sha: 1ebb40a7

1 Like

This commit appears in #12611 which was approved by jordanvidrine and CvX. It was merged by awesomerobot.

This commit has been mentioned on Discourse Meta. There might be relevant details there: