From 0df16da9f641f6963c48872320a5b233e87b9148 Mon Sep 17 00:00:00 2001 From: Hector Castejon Diaz Date: Mon, 13 May 2024 15:39:44 +0200 Subject: [PATCH] Context --- config/config.go | 1 - httpclient/oauth_token.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index 78cc863cc..6cbdd7b2e 100644 --- a/config/config.go +++ b/config/config.go @@ -220,7 +220,6 @@ func (c *Config) GetToken() (*oauth2.Token, error) { if err != nil { return nil, err } - //ctx := c.refreshClient.InContextForOAuth2(c.refreshCtx) if h, ok := c.credentialsProvider.(credentials.OAuthCredentialsProvider); ok { return h.Token() } else { diff --git a/httpclient/oauth_token.go b/httpclient/oauth_token.go index 65df5e4f8..5b33793a3 100644 --- a/httpclient/oauth_token.go +++ b/httpclient/oauth_token.go @@ -35,7 +35,7 @@ func (c *ApiClient) GetOAuthToken(authDetails string, token *oauth2.Token) (*cre WithUrlEncodedData(data), WithResponseUnmarshal(&response), } - err := c.Do(context.Background(), http.MethodPost, path, opts...) + err := c.Do(c.InContextForOAuth2(context.Background()), http.MethodPost, path, opts...) if err != nil { return nil, err }