( client *dashboard.Client, accessToken string, )
| 347 | } |
| 348 | |
| 349 | func (opts *OpenOptions) fetchAccountApplications( |
| 350 | client *dashboard.Client, |
| 351 | accessToken string, |
| 352 | ) ([]dashboard.Application, error) { |
| 353 | listFn := opts.ListApplications |
| 354 | if listFn == nil { |
| 355 | listFn = func(c *dashboard.Client, token string) ([]dashboard.Application, error) { |
| 356 | return c.ListApplications(token) |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | opts.IO.StartProgressIndicatorWithLabel("Fetching applications") |
| 361 | apps, err := listFn(client, accessToken) |
| 362 | opts.IO.StopProgressIndicator() |
| 363 | if err != nil { |
| 364 | newToken, reAuthErr := auth.ReauthenticateIfExpired(opts.IO, client, err) |
| 365 | if reAuthErr != nil { |
| 366 | return nil, reAuthErr |
| 367 | } |
| 368 | opts.IO.StartProgressIndicatorWithLabel("Fetching applications") |
| 369 | apps, err = listFn(client, newToken) |
| 370 | opts.IO.StopProgressIndicator() |
| 371 | if err != nil { |
| 372 | return nil, err |
| 373 | } |
| 374 | } |
| 375 | |
| 376 | return apps, nil |
| 377 | } |
| 378 | |
| 379 | // resolveApplicationForAccount returns an application ID that belongs to the |
| 380 | // signed-in account. The configured profile application is used only when it |
no test coverage detected