From 1e46739a51a981d49183a31feb8e37742f83b8d3 Mon Sep 17 00:00:00 2001 From: Cyril David Date: Fri, 4 Feb 2022 17:04:30 -0800 Subject: [PATCH] fix: auth0 tenants add: blank slate (#394) 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. --- internal/cli/tenants.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/cli/tenants.go b/internal/cli/tenants.go index 10e1b8a2a..b17e6176d 100644 --- a/internal/cli/tenants.go +++ b/internal/cli/tenants.go @@ -1,6 +1,7 @@ package cli import ( + "errors" "fmt" "github.com/auth0/auth0-cli/internal/prompt" @@ -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]