Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/auth0/auth0-cli/internal/config"
"github.com/auth0/auth0-cli/internal/display"
"github.com/auth0/auth0-cli/internal/iostream"
"github.com/auth0/auth0-cli/internal/prompt"
)

const userAgent = "Auth0 CLI"
Expand Down Expand Up @@ -92,15 +93,23 @@ func (c *cli) setupWithAuthentication(ctx context.Context) error {
"secret in the keyring.\n\n"+
"Please re-authenticate by running: %s",
err,
ansi.Bold("auth0 login --domain <tenant-domain --client-id <client-id> --client-secret <client-secret>"),
ansi.Bold("auth0 login --domain <tenant-domain> --client-id <client-id> --client-secret <client-secret>"),
)
return errorMessage
}

c.renderer.Warnf("Failed to renew access token: %s", err)
c.renderer.Warnf("Please log in to re-authorize the CLI.\n")

tenant, err = RunLoginAsUser(ctx, c, tenant.GetExtraRequestedScopes(), "")
// Determine tenant domain for login.
tenantDomain := ""
if c.Config.DefaultTenant != "" {
if prompt.Confirm(fmt.Sprintf("Continue login with default tenant '%s'?", c.Config.DefaultTenant)) {
tenantDomain = c.Config.DefaultTenant
}
}

tenant, err = RunLoginAsUser(ctx, c, tenant.GetExtraRequestedScopes(), tenantDomain)
if err != nil {
return err
}
Expand Down
Loading