mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-05 23:53:21 +00:00
filter unsupported user entries by email length
This commit is contained in:
@@ -51,7 +51,7 @@ export class SyncService {
|
||||
try {
|
||||
const entries = await directoryService.getEntries(force || syncConfig.overwriteExisting, test);
|
||||
let groups = entries[0];
|
||||
let users = entries[1];
|
||||
let users = this.filterUnsupportedUsers(entries[1]);
|
||||
|
||||
if (groups != null && groups.length > 0) {
|
||||
this.flattenUsersToGroups(groups, groups);
|
||||
@@ -103,6 +103,10 @@ export class SyncService {
|
||||
}
|
||||
}
|
||||
|
||||
private filterUnsupportedUsers(users: UserEntry[]): UserEntry[] {
|
||||
return users.filter((u) => u.email.length <= 50);
|
||||
}
|
||||
|
||||
private flattenUsersToGroups(levelGroups: GroupEntry[], allGroups: GroupEntry[]): Set<string> {
|
||||
let allUsers = new Set<string>();
|
||||
for (const group of levelGroups) {
|
||||
|
||||
Reference in New Issue
Block a user