oauth: Use custom http client so that --no-check-certificate is honored by oauth token fetch

Fixes #4085
master
Mark Spieth 2020-03-22 23:28:19 +11:00 committed by GitHub
parent 32df634cb6
commit 45b63e2d45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -503,7 +503,8 @@ func doConfig(id, name string, m configmap.Mapper, oauthConfig *oauth2.Config, o
}
// Exchange the code for a token
token, err := oauthConfig.Exchange(context.Background(), auth.Code)
ctx := Context(fshttp.NewClient(fs.Config))
token, err := oauthConfig.Exchange(ctx, auth.Code)
if err != nil {
return errors.Wrap(err, "failed to get token")
}