Merge pull request #3469 from nzalev/handle-ldap-socket-err

Handle ldap on 'error'
This commit is contained in:
Ylian Saint-Hilaire 2022-01-16 14:04:44 -08:00 committed by GitHub
commit f79b28ac6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -550,6 +550,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
// LDAP login
var LdapAuth = require('ldapauth-fork');
var ldap = new LdapAuth(domain.ldapoptions);
ldap.on('error', function (err) { console.log('ldap error: ', err); });
ldap.authenticate(name, pass, function (err, xxuser) {
try { ldap.close(); } catch (ex) { console.log(ex); } // Close the LDAP object
if (err) { fn(new Error('invalid password')); return; }