File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/app/integrations/providers Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -263,12 +263,16 @@ export class AwsSsoService extends NativeService {
263263
264264 listAccounts ( accessToken : string , region : string ) : Observable < any > {
265265 this . ssoPortal = new SSO ( { region } ) ;
266-
267- const listAccountsRequest : ListAccountsRequest = { accessToken } ;
268-
266+ const listAccountsRequest : ListAccountsRequest = { accessToken, maxResults : 10 } ;
269267 return fromPromise ( this . ssoPortal . listAccounts ( listAccountsRequest ) . promise ( ) ) . pipe (
270268 expand ( ( response : ListAccountsResponse ) => {
271- return ( response . nextToken !== null ? fromPromise ( this . ssoPortal . listAccounts ( listAccountsRequest ) . promise ( ) ) : EMPTY ) ;
269+ if ( response . nextToken !== null ) {
270+ // Add the token to the params
271+ listAccountsRequest [ 'nextToken' ] = response . nextToken ;
272+ return fromPromise ( this . ssoPortal . listAccounts ( listAccountsRequest ) . promise ( ) ) ;
273+ } else {
274+ return EMPTY ;
275+ }
272276 } ) ,
273277 take ( 300 ) , // safety block for now
274278 toArray ( ) ,
You can’t perform that action at this time.
0 commit comments