Reconnect to LDAP when connection is closed (or not open at the beginning)
parent
dc7b554c8d
commit
ccbcb758f0
|
@ -5,3 +5,4 @@ coverage/
|
||||||
|
|
||||||
*.swp
|
*.swp
|
||||||
|
|
||||||
|
*.sh
|
||||||
|
|
|
@ -7,5 +7,4 @@ RUN npm install
|
||||||
|
|
||||||
COPY src /usr/src
|
COPY src /usr/src
|
||||||
|
|
||||||
|
|
||||||
CMD ["node", "index.js"]
|
CMD ["node", "index.js"]
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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');
|
||||||
|
|
|
@ -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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue