X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2Fauth.js;h=b56f09fbc9f736d254689b45a09e73309da69ec2;hb=3d716d9ef715d3bfd70631161d022abda0467b71;hp=6ddb125b1c6a543c4fefa2d9c3e63f0916089297;hpb=f9f5c021adfc209eb095e682292db5e1ccdd272c;p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git 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; if (LDAP_URL && LDAP_USERS_BASE_DN) { console.log('Enable ldap auth'); - exports.ldap = passport.authenticate('ldap'); + exports.verify = passport.authenticate('ldap'); } else { console.log('Use local user file:', LOCAL_AUTH_FILE); - exports.ldap = function (req, res, next) { + exports.verify = function (req, res, next) { var users = safe.JSON.parse(safe.fs.readFileSync(LOCAL_AUTH_FILE)); if (!users) return res.send(401); if (!users[req.query.username]) return res.send(401);