Skip to content

Commit

Permalink
Avoid double admin password request on instances add
Browse files Browse the repository at this point in the history
  • Loading branch information
sblaisot committed Nov 24, 2023
1 parent d36a85e commit 524f298
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/admin_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (ac *AdminClient) NewInstanceClient(domain string, scopes ...string) (*Clie
httpClient, clientURL, err := tlsclient.NewHTTPClient(tlsclient.HTTPEndpoint{
Host: config.GetConfig().Host,
Port: config.GetConfig().Port,
Timeout: 5 * time.Minute,
Timeout: 15 * time.Minute,
EnvPrefix: "COZY_HOST",
})
if err != nil {
Expand Down
8 changes: 7 additions & 1 deletion cmd/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,13 @@ be used as the error message.
if len(flagApps) == 0 {
return nil
}
apps, err := newClient(domain, consts.Apps).ListApps(consts.Apps)
c, err := ac.NewInstanceClient(domain, consts.Apps)
if err != nil {
errPrintfln("Could not generate access to domain %s", domain)
errPrintfln("%s", err)
os.Exit(1)
}
apps, err := c.ListApps(consts.Apps)
if err == nil && len(flagApps) != len(apps) {
for _, slug := range flagApps {
found := false
Expand Down

0 comments on commit 524f298

Please sign in to comment.