1
0
mirror of https://github.com/smallstep/cli.git synced 2025-08-09 03:22:43 +03:00

Adjust if statement from PR feedback.

This commit is contained in:
Joe Doss
2025-02-12 10:24:19 -06:00
committed by Herman Slatman
parent c8872948a4
commit 191dc06137

View File

@@ -784,24 +784,22 @@ func (o *oauth) DoLoopbackAuthorization() (*token, error) {
return nil, err
}
skipBrowser := os.Getenv("STEP_OPEN_BROWSER") == "false"
if !skipBrowser {
if err := exec.OpenInBrowser(authURL, o.browser); err != nil {
fmt.Fprintln(os.Stderr, "Cannot open a web browser on your platform.")
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "Open a local web browser and visit:")
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, authURL)
fmt.Fprintln(os.Stderr)
} else {
fmt.Fprintln(os.Stderr, "Your default web browser has been opened to visit:")
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, authURL)
fmt.Fprintln(os.Stderr)
}
} else {
fmt.Fprintln(os.Stderr, authURL)
if skipBrowser := os.Getenv("STEP_OPEN_BROWSER") == "0"; skipBrowser {
fmt.Fprintln(os.Stderr, authURL)
} else {
if err := exec.OpenInBrowser(authURL, o.browser); err != nil {
fmt.Fprintln(os.Stderr, "Cannot open a web browser on your platform.")
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "Open a local web browser and visit:")
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, authURL)
fmt.Fprintln(os.Stderr)
} else {
fmt.Fprintln(os.Stderr, "Your default web browser has been opened to visit:")
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, authURL)
fmt.Fprintln(os.Stderr)
}
}
// Wait for response and return the token