eslint: add no-shadow
This commit is contained in:
+5
-5
@@ -110,10 +110,10 @@ async function clientSearch(client, dn, searchOptions) {
|
||||
const ldapObjects = [];
|
||||
|
||||
result.on('searchEntry', entry => ldapObjects.push(entry.object));
|
||||
result.on('error', error => reject(new BoxError(BoxError.EXTERNAL_ERROR, `search error: ${error.message}`)));
|
||||
result.on('error', searchError => reject(new BoxError(BoxError.EXTERNAL_ERROR, `search error: ${searchError.message}`)));
|
||||
|
||||
result.on('end', function (result) {
|
||||
if (result.status !== 0) return reject(new BoxError(BoxError.EXTERNAL_ERROR, 'Server returned status ' + result.status));
|
||||
result.on('end', function (searchResult) {
|
||||
if (searchResult.status !== 0) return reject(new BoxError(BoxError.EXTERNAL_ERROR, 'Server returned status ' + searchResult.status));
|
||||
|
||||
resolve(ldapObjects);
|
||||
});
|
||||
@@ -481,7 +481,7 @@ async function syncGroupMembers(config, progressCallback) {
|
||||
|
||||
const userIds = [];
|
||||
for (const memberDn of ldapGroupMembers) {
|
||||
const [ldapError, result] = await safe(ldapGetByDN(config, memberDn));
|
||||
const [ldapError, memberResult] = await safe(ldapGetByDN(config, memberDn));
|
||||
if (ldapError) {
|
||||
debug(`syncGroupMembers: Group ${ldapGroup.name} failed to get ${memberDn}: %o`, ldapError);
|
||||
continue;
|
||||
@@ -489,7 +489,7 @@ async function syncGroupMembers(config, progressCallback) {
|
||||
|
||||
debug(`syncGroupMembers: Group ${ldapGroup.name} has member object ${memberDn}`);
|
||||
|
||||
const username = result[config.usernameField]?.toLowerCase();
|
||||
const username = memberResult[config.usernameField]?.toLowerCase();
|
||||
if (!username) continue;
|
||||
|
||||
const [getError, userObject] = await safe(users.getByUsername(username));
|
||||
|
||||
Reference in New Issue
Block a user