File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,16 +26,21 @@ export async function getAdminService() {
2626
2727export async function getGithubUsersFromGoogle ( ) : Promise < Set < string > > {
2828 const service = await mod . getAdminService ( )
29+ let githubAccounts = new Set < string > ( )
30+ let nextPageToken = null
2931
30- const userList = await service . users . list ( {
31- customer : 'my_customer' ,
32- maxResults : 250 ,
33- projection : 'custom' ,
34- fields : 'users(customSchemas/Accounts/github(value))' ,
35- customFieldMask : 'Accounts' ,
36- } )
37-
38- const githubAccounts = mod . formatUserList ( userList . data . users )
32+ do {
33+ const userList = await service . users . list ( {
34+ customer : 'my_customer' ,
35+ maxResults : 250 ,
36+ projection : 'custom' ,
37+ nextPageToken : nextPageToken ,
38+ fields : 'users(customSchemas/Accounts/github(value)),nextPageToken' ,
39+ customFieldMask : 'Accounts' ,
40+ } )
41+ nextPageToken = userList . data . nextPageToken
42+ githubAccounts = new Set ( [ ...githubAccounts , ...formatUserList ( userList . data . users ) ] )
43+ } while ( nextPageToken != null )
3944 return githubAccounts
4045}
4146
You can’t perform that action at this time.
0 commit comments