Procházet zdrojové kódy

hide password auth with PASSWORD_LOGIN_ENABLED variable

salleman před 5 roky
rodič
revize
3e817257ef
2 změnil soubory, kde provedl 10 přidání a 0 odebrání
  1. 5 0
      client/components/main/layouts.js
  2. 5 0
      models/settings.js

+ 5 - 0
client/components/main/layouts.js

@@ -31,6 +31,11 @@ Template.userFormsLayout.onCreated(function() {
       return this.stop();
     },
   });
+  Meteor.call('isPasswordDisabled', (_, result) => {
+    if (result) {
+      $('.at-pwd-form').hide();
+    }
+  });
 });
 
 Template.userFormsLayout.onRendered(() => {

+ 5 - 0
models/settings.js

@@ -334,6 +334,11 @@ if (Meteor.isServer) {
     getDefaultAuthenticationMethod() {
       return process.env.DEFAULT_AUTHENTICATION_METHOD;
     },
+
+    isPasswordDisabled() {
+      return process.env.PASSWORD_LOGIN_ENABLED === 'false';
+    },
+
   });
 }