Skip to content

Commit

Permalink
use ensureArray
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-lehnen-rc committed Mar 31, 2022
1 parent 6eccc47 commit 34d4c2a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ee/server/lib/ldap/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { templateVarHandler } from '../../../../app/utils/lib/templateVarHandler
import { addUserToRoom, removeUserFromRoom, createRoom } from '../../../../app/lib/server/functions';
import { syncUserRoles } from '../syncUserRoles';
import { Team } from '../../../../server/sdk';
import { ensureArray } from '../../../../lib/utils/arrayUtils';

export class LDAPEEManager extends LDAPManager {
public static async sync(): Promise<void> {
Expand Down Expand Up @@ -224,7 +225,7 @@ export class LDAPEEManager extends LDAPManager {
continue;
}

const userFields: string[] = Array.isArray(fieldMap[ldapField]) ? fieldMap[ldapField] : [fieldMap[ldapField]];
const userFields = ensureArray<string>(fieldMap[ldapField]);

for await (const userField of userFields) {
const [roleId] = userField.split(/\.(.+)/);
Expand Down

0 comments on commit 34d4c2a

Please sign in to comment.