1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-11 05:43:26 +00:00

add paging to group members api request

This commit is contained in:
Kyle Spearrin
2020-04-24 11:25:00 -04:00
parent 7d36a50687
commit 8b2fa8405b
2 changed files with 17 additions and 9 deletions

2
jslib

Submodule jslib updated: 8438cafbd0...2de8c5ed16

View File

@@ -306,7 +306,8 @@ export class AzureDirectoryService extends BaseDirectoryService implements Direc
entry.name = group.displayName;
const memReq = this.client.api('/groups/' + group.id + '/members');
const memRes = await memReq.get();
let memRes = await memReq.get();
while (true) {
const members: any = memRes.value;
if (members != null) {
for (const member of members) {
@@ -317,6 +318,13 @@ export class AzureDirectoryService extends BaseDirectoryService implements Direc
}
}
}
if (memRes[NextLink] == null) {
break;
} else {
const nextMemReq = this.client.api(memRes[NextLink]);
memRes = await nextMemReq.get();
}
}
return entry;
}