From 454df630880d3c6e0f03b0d6c9f03458cdfeb434 Mon Sep 17 00:00:00 2001 From: Grey Newell Date: Wed, 4 Mar 2026 16:31:59 -0500 Subject: [PATCH] feat: add UNCOMPACT_CLI_AUTH_URL env override for local testing Allow overriding the CLI auth dashboard URL via environment variable so developers can test the browser callback flow against a local dashboard instance. Co-Authored-By: Grey Newell Co-Authored-By: Claude Sonnet 4.6 --- cmd/auth.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/auth.go b/cmd/auth.go index cfd6fbe..c63aff1 100644 --- a/cmd/auth.go +++ b/cmd/auth.go @@ -170,7 +170,11 @@ func authLoginBrowser(cfg *config.Config) (string, error) { _ = server.Shutdown(ctx) }() - dashURL := fmt.Sprintf("%s?port=%d&state=%s", config.DashboardCLIAuthURL, port, state) + cliAuthURL := config.DashboardCLIAuthURL + if override := os.Getenv("UNCOMPACT_CLI_AUTH_URL"); override != "" { + cliAuthURL = override + } + dashURL := fmt.Sprintf("%s?port=%d&state=%s", cliAuthURL, port, state) fmt.Println("Opening your browser to sign in...") fmt.Printf(" %s\n\n", dashURL) fmt.Println("Waiting for authentication (this will timeout in 2 minutes)...")