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

Fixes #4085
This commit is contained in:
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

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")
}