Skip to content

Commit

Permalink
fix: always print the login URL on key renew flow
Browse files Browse the repository at this point in the history
Instead of printing the login URL only when env var `BROWSER=echo` is set, always print it to stderr. So if the `browser` package fails to open the URL but "thinks" that it didn't fail, we still have the URL printed to the console.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
  • Loading branch information
utkuozdemir committed Oct 25, 2023
1 parent d28609a commit 370cebf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/client/interceptor/key.go
Expand Up @@ -54,6 +54,8 @@ func renewUserKeyViaAuthFlow(ctx context.Context, cc *grpc.ClientConn, options *
if browserEnv == "echo" {
printLoginDialog()
} else {
fmt.Fprintf(os.Stderr, "Attempting to open URL: %s\n", loginURL)

err = browser.OpenURL(loginURL)
if err != nil {
printLoginDialog()
Expand Down

0 comments on commit 370cebf

Please sign in to comment.