diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/auth.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/auth.js b/src/auth.js index 6ddb125..b56f09f 100644 --- a/src/auth.js +++ b/src/auth.js | |||
@@ -24,11 +24,11 @@ var LDAP_USERS_BASE_DN = process.env.LDAP_USERS_BASE_DN; | |||
24 | if (LDAP_URL && LDAP_USERS_BASE_DN) { | 24 | if (LDAP_URL && LDAP_USERS_BASE_DN) { |
25 | console.log('Enable ldap auth'); | 25 | console.log('Enable ldap auth'); |
26 | 26 | ||
27 | exports.ldap = passport.authenticate('ldap'); | 27 | exports.verify = passport.authenticate('ldap'); |
28 | } else { | 28 | } else { |
29 | console.log('Use local user file:', LOCAL_AUTH_FILE); | 29 | console.log('Use local user file:', LOCAL_AUTH_FILE); |
30 | 30 | ||
31 | exports.ldap = function (req, res, next) { | 31 | exports.verify = function (req, res, next) { |
32 | var users = safe.JSON.parse(safe.fs.readFileSync(LOCAL_AUTH_FILE)); | 32 | var users = safe.JSON.parse(safe.fs.readFileSync(LOCAL_AUTH_FILE)); |
33 | if (!users) return res.send(401); | 33 | if (!users) return res.send(401); |
34 | if (!users[req.query.username]) return res.send(401); | 34 | if (!users[req.query.username]) return res.send(401); |