Skip to content

Commit 295c5d1

Browse files
committed
Fix opening OAuth URL in browser
1 parent b21b93a commit 295c5d1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

auth/oauth.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"os"
1212
"os/exec"
1313
"runtime"
14+
"strings"
1415
)
1516

1617
func randomString(length int) (string, error) {
@@ -101,11 +102,14 @@ func openInBrowser(url string) error {
101102
args = []string{"open"}
102103
case "windows":
103104
args = []string{"cmd", "/c", "start"}
105+
r := strings.NewReplacer("&", "^&")
106+
url = r.Replace(url)
104107
default:
105108
args = []string{"xdg-open"}
106109
}
107110

108111
args = append(args, url)
109112
cmd := exec.Command(args[0], args[1:]...)
113+
cmd.Stderr = os.Stderr
110114
return cmd.Run()
111115
}

0 commit comments

Comments
 (0)