Skip to content

Commit

Permalink
fix: auth0 tenants add: blank slate (#394)
Browse files Browse the repository at this point in the history
For the blank slate case, we don't want it to error out if there are no
tenants since by definition we have no tenants configured.
  • Loading branch information
cyx authored Feb 5, 2022
1 parent fd0ce1d commit 1e46739
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/cli/tenants.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cli

import (
"errors"
"fmt"

"github.com/auth0/auth0-cli/internal/prompt"
Expand Down Expand Up @@ -166,7 +167,13 @@ func addTenantCmd(cli *cli) *cobra.Command {
if len(args) == 0 {
err := tenantDomain.Pick(cmd, &inputs.Domain, cli.tenantPickerOptions)
if err != nil {
return err
if !errors.Is(err, errUnauthenticated) {
return err
}

if err := tenantDomain.Ask(cmd, &inputs.Domain); err != nil {
return err
}
}
} else {
inputs.Domain = args[0]
Expand Down

0 comments on commit 1e46739

Please sign in to comment.