mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-26 23:25:53 -05:00
Handle ldap on 'error'
This commit is contained in:
parent
545ffe3a81
commit
fe6e466d11
@ -550,6 +550,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
|
|||||||
// LDAP login
|
// LDAP login
|
||||||
var LdapAuth = require('ldapauth-fork');
|
var LdapAuth = require('ldapauth-fork');
|
||||||
var ldap = new LdapAuth(domain.ldapoptions);
|
var ldap = new LdapAuth(domain.ldapoptions);
|
||||||
|
ldap.on('error', function (err) { console.log('ldap error: ', err); });
|
||||||
ldap.authenticate(name, pass, function (err, xxuser) {
|
ldap.authenticate(name, pass, function (err, xxuser) {
|
||||||
try { ldap.close(); } catch (ex) { console.log(ex); } // Close the LDAP object
|
try { ldap.close(); } catch (ex) { console.log(ex); } // Close the LDAP object
|
||||||
if (err) { fn(new Error('invalid password')); return; }
|
if (err) { fn(new Error('invalid password')); return; }
|
||||||
|
Loading…
Reference in New Issue
Block a user