Skip to content

Commit

Permalink
DXCDT-587: Warn if deleting client used to authenticate (#934)
Browse files Browse the repository at this point in the history
Adding warning message

Co-authored-by: Will Vedder <[email protected]>
  • Loading branch information
willvedd and willvedd authored Dec 5, 2023
1 parent ed632b4 commit 3ea19cd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/cli/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ 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 confirmed := prompt.Confirm("Are you sure you want to proceed?"); !confirmed {
return nil
}
Expand Down

0 comments on commit 3ea19cd

Please sign in to comment.