Use normal bind()

This commit is contained in:
Johannes Zellner
2021-10-26 18:47:51 +02:00
parent 50ff6b99e0
commit cef5c1e78c
+1 -4
View File
@@ -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);