Skip to content

Commit

Permalink
WIP debug open browser command
Browse files Browse the repository at this point in the history
  • Loading branch information
monde committed Jan 24, 2024
1 parent e74230c commit 47d8005
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/webssoauth/webssoauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,15 +751,16 @@ func (w *WebSSOAuthentication) promptAuthentication(da *okta.DeviceAuthorization
bArgs = append(bArgs, da.VerificationURIComplete)
cmd := osexec.Command(bArgs[0], bArgs[1:]...)
out, err := cmd.Output()
if _, ok := err.(*osexec.ExitError); ok {
// TODO don't strategically swallow all errors?
// if _, ok := err.(*osexec.ExitError); ok {
if err != nil {
w.consolePrint("Failed to open activation URL with given browser: %v\n", err)
w.consolePrint(" %s\n", strings.Join(bArgs, " "))
}
if len(out) > 0 {
w.consolePrint("browser output:\n%s\n", string(out))
}
}

} else if w.config.OpenBrowser() {
brwsr.Stdout = os.Stderr
if err := brwsr.OpenURL(da.VerificationURIComplete); err != nil {
Expand Down

0 comments on commit 47d8005

Please sign in to comment.