@@ -15,6 +15,7 @@ import (
1515 "github.com/auth0/auth0-cli/internal/config"
1616 "github.com/auth0/auth0-cli/internal/display"
1717 "github.com/auth0/auth0-cli/internal/iostream"
18+ "github.com/auth0/auth0-cli/internal/prompt"
1819)
1920
2021const userAgent = "Auth0 CLI"
@@ -92,15 +93,23 @@ func (c *cli) setupWithAuthentication(ctx context.Context) error {
9293 "secret in the keyring.\n \n " +
9394 "Please re-authenticate by running: %s" ,
9495 err ,
95- ansi .Bold ("auth0 login --domain <tenant-domain --client-id <client-id> --client-secret <client-secret>" ),
96+ ansi .Bold ("auth0 login --domain <tenant-domain> --client-id <client-id> --client-secret <client-secret>" ),
9697 )
9798 return errorMessage
9899 }
99100
100101 c .renderer .Warnf ("Failed to renew access token: %s" , err )
101102 c .renderer .Warnf ("Please log in to re-authorize the CLI.\n " )
102103
103- tenant , err = RunLoginAsUser (ctx , c , tenant .GetExtraRequestedScopes (), "" )
104+ // Determine tenant domain for login.
105+ tenantDomain := ""
106+ if c .Config .DefaultTenant != "" {
107+ if prompt .Confirm (fmt .Sprintf ("Continue login with default tenant '%s'?" , c .Config .DefaultTenant )) {
108+ tenantDomain = c .Config .DefaultTenant
109+ }
110+ }
111+
112+ tenant , err = RunLoginAsUser (ctx , c , tenant .GetExtraRequestedScopes (), tenantDomain )
104113 if err != nil {
105114 return err
106115 }
0 commit comments