diff --git a/cli/pkg/oauth/oauth.go b/cli/pkg/oauth/oauth.go index 449a0b1a71..4e5fb7f5a3 100644 --- a/cli/pkg/oauth/oauth.go +++ b/cli/pkg/oauth/oauth.go @@ -6,7 +6,7 @@ import ( "io" "net" "net/http" - "path" + neturl "net/url" "sync" "github.com/kubeshop/tracetest/cli/ui" @@ -59,7 +59,10 @@ func (s *OAuthServer) GetAuthJWT() error { return fmt.Errorf("failed to start oauth server: %w", err) } - loginUrl := path.Join(s.frontendEndpoint, fmt.Sprintf("oauth?callback=%s", url)) + loginUrl, err := neturl.JoinPath(s.frontendEndpoint, fmt.Sprintf("oauth?callback=%s", url)) + if err != nil { + return fmt.Errorf("could not build path: %w", err) + } ui := ui.DefaultUI err = ui.OpenBrowser(loginUrl)