From 5ba8377106621e4cc57ba5b152f3b8a600db0850 Mon Sep 17 00:00:00 2001 From: denniskniep Date: Mon, 10 May 2021 19:12:11 +0200 Subject: [PATCH] Remove text in oidc command on json format (#1213) Fixes #1193 Fixes that the openid connect authenticate command formatted as json returns disturbing text. Therefore it can not be piped and parsed by another tool --- internal/cmd/commands/authenticate/oidc.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/cmd/commands/authenticate/oidc.go b/internal/cmd/commands/authenticate/oidc.go index b50469acb..bffe82d03 100644 --- a/internal/cmd/commands/authenticate/oidc.go +++ b/internal/cmd/commands/authenticate/oidc.go @@ -101,7 +101,9 @@ func (c *OidcCommand) Run(args []string) int { return base.CommandCliError } - c.UI.Output("Opening returned authentication URL in your browser...") + if base.Format(c.UI) == "table" { + c.UI.Output("Opening returned authentication URL in your browser...") + } if err := util.OpenURL(startResp.AuthUrl); err != nil { c.UI.Error(fmt.Errorf("Unable to open authentication URL in browser: %w", err).Error()) c.UI.Warn("Please open the following URL manually in your web browser:")