Fix ldap config not initialize properly

This commit is contained in:
Wu Cheng-Han 2017-02-07 22:31:38 +08:00
parent bbbf64aae4
commit 1cc27e1794

View file

@ -96,7 +96,7 @@ var google = (process.env.HMD_GOOGLE_CLIENTID && process.env.HMD_GOOGLE_CLIENTSE
clientID: process.env.HMD_GOOGLE_CLIENTID, clientID: process.env.HMD_GOOGLE_CLIENTID,
clientSecret: process.env.HMD_GOOGLE_CLIENTSECRET clientSecret: process.env.HMD_GOOGLE_CLIENTSECRET
} : (config.google && config.google.clientID && config.google.clientSecret && config.google) || false; } : (config.google && config.google.clientID && config.google.clientSecret && config.google) || false;
var ldap = config.ldap || ( var ldap = config.ldap || ((
process.env.HMD_LDAP_URL || process.env.HMD_LDAP_URL ||
process.env.HMD_LDAP_BINDDN || process.env.HMD_LDAP_BINDDN ||
process.env.HMD_LDAP_BINDCREDENTIALS || process.env.HMD_LDAP_BINDCREDENTIALS ||
@ -104,10 +104,9 @@ var ldap = config.ldap || (
process.env.HMD_LDAP_SEARCHBASE || process.env.HMD_LDAP_SEARCHBASE ||
process.env.HMD_LDAP_SEARCHFILTER || process.env.HMD_LDAP_SEARCHFILTER ||
process.env.HMD_LDAP_SEARCHATTRIBUTES || process.env.HMD_LDAP_SEARCHATTRIBUTES ||
process.env.HMD_LDAP_TLS_CA ||
process.env.HMD_LDAP_PROVIDERNAME process.env.HMD_LDAP_PROVIDERNAME
) || false; ) ? {} : false);
if (ldap == true)
ldap = {};
if (process.env.HMD_LDAP_URL) if (process.env.HMD_LDAP_URL)
ldap.url = process.env.HMD_LDAP_URL; ldap.url = process.env.HMD_LDAP_URL;
if (process.env.HMD_LDAP_BINDDN) if (process.env.HMD_LDAP_BINDDN)