From 295c5d122b973de8dffdb096ae93191ac9b52702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 27 Nov 2019 14:08:42 +0100 Subject: [PATCH] Fix opening OAuth URL in browser --- auth/oauth.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/auth/oauth.go b/auth/oauth.go index dba975f41..8325519fd 100644 --- a/auth/oauth.go +++ b/auth/oauth.go @@ -11,6 +11,7 @@ import ( "os" "os/exec" "runtime" + "strings" ) func randomString(length int) (string, error) { @@ -101,11 +102,14 @@ func openInBrowser(url string) error { args = []string{"open"} case "windows": args = []string{"cmd", "/c", "start"} + r := strings.NewReplacer("&", "^&") + url = r.Replace(url) default: args = []string{"xdg-open"} } args = append(args, url) cmd := exec.Command(args[0], args[1:]...) + cmd.Stderr = os.Stderr return cmd.Run() }