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

pull/1/head
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
*.sh

View File

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

View File

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

View File

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

View File

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

View File

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