Explorar o código

ensure that googleLoginEnabled returns false if Passport is enabled

Yuki Takei %!s(int64=8) %!d(string=hai) anos
pai
achega
ac42cb8653
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      lib/util/swigFunctions.js

+ 6 - 0
lib/util/swigFunctions.js

@@ -70,6 +70,12 @@ module.exports = function(crowi, app, req, locals) {
   }
 
   locals.googleLoginEnabled = function() {
+    // return false if Passport is enabled
+    // because official crowi mechanism is not used.
+    if (locals.isEnabledPassport()) {
+      return false;
+    }
+
     var config = crowi.getConfig()
     return config.crowi['google:clientId'] && config.crowi['google:clientSecret'];
   };