Reconnect to LDAP when connection is closed (or not open at the beginning)

This commit is contained in:
Clement Michaud 2016-12-18 01:49:09 +01:00
parent dc7b554c8d
commit ccbcb758f0
6 changed files with 6 additions and 5 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ coverage/
*.swp *.swp
*.sh

View File

@ -7,5 +7,4 @@ RUN npm install
COPY src /usr/src COPY src /usr/src
CMD ["node", "index.js"] CMD ["node", "index.js"]

View File

@ -13,8 +13,8 @@ var config = {
} }
var ldap_client = ldap.createClient({ var ldap_client = ldap.createClient({
url: config.ldap_url url: config.ldap_url,
reconnect: true
}); });
server.run(config, ldap_client); server.run(config, ldap_client);

View File

@ -49,7 +49,6 @@ function authenticate(req, res) {
function verify_authentication(req, res) { function verify_authentication(req, res) {
console.log('Verify authentication'); console.log('Verify authentication');
console.log(req.cookies);
if(!objectPath.has(req, 'cookies.access_token')) { if(!objectPath.has(req, 'cookies.access_token')) {
return utils.reject('No access token provided'); return utils.reject('No access token provided');

View File

@ -33,7 +33,6 @@ function serveAuthPost(req, res) {
} }
function serveLogin(req, res) { function serveLogin(req, res) {
console.log(req.headers);
res.render('login'); res.render('login');
} }

View File

@ -107,6 +107,9 @@ describe('test the server', function() {
(content.indexOf('This is a very important secret!') > -1); (content.indexOf('This is a very important secret!') > -1);
assert(is_secret_page_content); assert(is_secret_page_content);
done(); done();
})
.fail(function(err) {
console.error(err);
}); });
}); });