Skip to content

Commit

Permalink
Honor force flag in login confirm prompt (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
Widcket authored Sep 4, 2021
1 parent 0f57d13 commit d4d063d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/cli/utils_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/auth0/auth0-cli/internal/auth/authutil"
"github.com/auth0/auth0-cli/internal/auth0"
"github.com/auth0/auth0-cli/internal/prompt"
"gopkg.in/auth0.v5/management"
"github.com/pkg/browser"
"gopkg.in/auth0.v5/management"
)

const (
Expand Down Expand Up @@ -98,9 +98,12 @@ func runLoginFlowPreflightChecks(cli *cli, c *management.Client) (abort bool) {
cli.renderer.Warnf("If you do not wish to modify the client, you can abort now.\n")
}

if confirmed := prompt.Confirm("Do you wish to proceed?"); !confirmed {
return false
if !cli.force {
if confirmed := prompt.Confirm("Do you wish to proceed?"); !confirmed {
return false
}
}

fmt.Fprint(cli.renderer.MessageWriter, "\n")

return true
Expand Down

0 comments on commit d4d063d

Please sign in to comment.