Fix opening OAuth URL in browser

This commit is contained in:
Mislav Marohnić 2019-11-27 14:08:42 +01:00
parent b21b93abe9
commit 295c5d122b

View file

@ -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()
}