Skip to content

Commit

Permalink
v2: fix URL building in oauthConfig
Browse files Browse the repository at this point in the history
The new logic keeps the double slash in https:// as opposed to truncating it to https:/

Updates #cleanup

Signed-off-by: Percy Wegmann <[email protected]>
  • Loading branch information
oxtoacart committed Sep 16, 2024
1 parent 34e007d commit e89a1ab
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions v2/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package tsclient
import (
"context"
"net/http"
"path"

"golang.org/x/oauth2/clientcredentials"
)
Expand All @@ -33,7 +32,7 @@ func (ocfg OAuthConfig) HTTPClient() *http.Client {
ClientID: ocfg.ClientID,
ClientSecret: ocfg.ClientSecret,
Scopes: ocfg.Scopes,
TokenURL: path.Join(baseURL, "/api/v2/oauth/token"),
TokenURL: baseURL + "/api/v2/oauth/token",
}

// Use context.Background() here, since this is used to refresh the token in the future.
Expand Down

0 comments on commit e89a1ab

Please sign in to comment.