diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-05-05 01:19:03 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-05-05 02:17:44 +0200 |
commit | 476177380452c9c7c5b1624805feedc824c5995e (patch) | |
tree | 42923ae21c6defb1070124a565ec9d118e849a8e | |
parent | ca2fe6ecc5142115ba163875ccce2d0947ee50dc (diff) | |
download | Surfer-476177380452c9c7c5b1624805feedc824c5995e.tar.gz Surfer-476177380452c9c7c5b1624805feedc824c5995e.tar.zst Surfer-476177380452c9c7c5b1624805feedc824c5995e.zip |
-rwxr-xr-x | server.js | 2 | ||||
-rw-r--r-- | src/auth.js | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -161,7 +161,7 @@ app.use('/', function (req, res) { | |||
161 | }); | 161 | }); |
162 | app.use(lastMile()); | 162 | app.use(lastMile()); |
163 | 163 | ||
164 | var server = app.listen(3000, function () { | 164 | var server = app.listen(process.env.LISTEN, function () { |
165 | var host = server.address().address; | 165 | var host = server.address().address; |
166 | var port = server.address().port; | 166 | var port = server.address().port; |
167 | 167 | ||
diff --git a/src/auth.js b/src/auth.js index 5f4c777..d575d60 100644 --- a/src/auth.js +++ b/src/auth.js | |||
@@ -71,8 +71,8 @@ function verifyUser(username, password, callback) { | |||
71 | ldapClient.bind(process.env.CLOUDRON_LDAP_BIND_DN, process.env.CLOUDRON_LDAP_BIND_PASSWORD, function (error) { | 71 | ldapClient.bind(process.env.CLOUDRON_LDAP_BIND_DN, process.env.CLOUDRON_LDAP_BIND_PASSWORD, function (error) { |
72 | if (error) return callback(error); | 72 | if (error) return callback(error); |
73 | 73 | ||
74 | var filter = `(|(uid=${username})(mail=${username})(username=${username})(sAMAccountName=${username}))`; | 74 | var filter = process.env.CLOUDRON_LDAP_FILTER.replace(/\{username\}/g, username); |
75 | ldapClient.search(process.env.CLOUDRON_LDAP_USERS_BASE_DN, { filter: filter }, function (error, result) { | 75 | ldapClient.search(process.env.CLOUDRON_LDAP_USERS_BASE_DN, { filter: filter, scope: "sub" }, function (error, result) { |
76 | if (error) return callback(error); | 76 | if (error) return callback(error); |
77 | 77 | ||
78 | var items = []; | 78 | var items = []; |