Skip to content

Commit

Permalink
Check to see if the tenant id is contained in the ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Christenson II committed Dec 5, 2023
1 parent 3163bdf commit 3b4394d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/cli/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"slices"
"strings"

"github.com/auth0/go-auth0/management"
Expand Down Expand Up @@ -328,8 +329,8 @@ func deleteAppCmd(cli *cli) *cobra.Command {
}

if !cli.force && canPrompt(cmd) {
if tenant, _ := cli.Config.GetTenant(cli.tenant); tenant.ClientID == inputs.ID {
cli.renderer.Warnf("Warning: You're about to delete the client used to authenticate the CLI. If deleted, the CLI will cease to operate once the access token has expired.", inputs.ID)
if tenant, _ := cli.Config.GetTenant(cli.tenant); slices.Contains(ids, tenant.ClientID) {
cli.renderer.Warnf("Warning: You're about to delete the client used to authenticate the CLI. If deleted, the CLI will cease to operate once the access token has expired.", ids)
}
if confirmed := prompt.Confirm("Are you sure you want to proceed?"); !confirmed {
return nil
Expand Down

0 comments on commit 3b4394d

Please sign in to comment.