Skip to content

Commit

Permalink
fix: oauth path building
Browse files Browse the repository at this point in the history
  • Loading branch information
mathnogueira committed Aug 28, 2024
1 parent 1651afc commit eb8121f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions cli/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ type Config struct {
}

func (c Config) OAuthEndpoint() string {
return fmt.Sprintf("%s%s", c.URL(), c.Path())

return path.Join(c.URL(), c.Path())
}

func (c Config) URL() string {
Expand Down
3 changes: 2 additions & 1 deletion cli/pkg/oauth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"
"net"
"net/http"
"path"
"sync"

"github.com/kubeshop/tracetest/cli/ui"
Expand Down Expand Up @@ -58,7 +59,7 @@ func (s *OAuthServer) GetAuthJWT() error {
return fmt.Errorf("failed to start oauth server: %w", err)
}

loginUrl := fmt.Sprintf("%soauth?callback=%s", s.frontendEndpoint, url)
loginUrl := path.Join(s.frontendEndpoint, fmt.Sprintf("oauth?callback=%s", url))

ui := ui.DefaultUI
err = ui.OpenBrowser(loginUrl)
Expand Down

0 comments on commit eb8121f

Please sign in to comment.