Use normal bind()
This commit is contained in:
+1
-4
@@ -291,10 +291,7 @@ async function verifyPassword(user, password) {
|
||||
|
||||
const client = await getClient(externalLdapConfig, { bind: false });
|
||||
|
||||
// create a separate function on the instance so we can call the promisified version with the correct this pointer
|
||||
client.bindPromisified = util.promisify(client.bind);
|
||||
|
||||
const [error] = await safe(client.bindPromisified(ldapUsers[0].dn, password));
|
||||
const [error] = await safe(util.promisify(client.bind.bind(client))(ldapUsers[0].dn, password));
|
||||
client.unbind();
|
||||
if (error instanceof ldap.InvalidCredentialsError) throw new BoxError(BoxError.INVALID_CREDENTIALS);
|
||||
if (error) throw new BoxError(BoxError.EXTERNAL_ERROR, error);
|
||||
|
||||
Reference in New Issue
Block a user