From 9df4a30fd5acdc104eacb8de65b2886a27063b8c Mon Sep 17 00:00:00 2001 From: Lars Krapf Date: Thu, 30 Sep 2021 08:36:03 +0200 Subject: [PATCH] Browser writing to stdout interferes with token storage - redirect browser stdout to avoid the "Opening in existing browser session." message from chromium when authenticating --- ims/authz_user.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ims/authz_user.go b/ims/authz_user.go index 86bbdb5..8a436a1 100644 --- a/ims/authz_user.go +++ b/ims/authz_user.go @@ -108,6 +108,9 @@ func (i Config) AuthorizeUser() (string, error) { localUrl := fmt.Sprintf("http://localhost:%d/", port) + // redirect stdout to avoid "Opening in existing browser session." message from chromium + browser.Stdout = nil + err = browser.OpenURL(localUrl) if err != nil { fmt.Fprintf(os.Stderr, "error launching the browser, open it and visit %s\n", localUrl)