improve: ts is already wrapped in ReuseTokenSource. Imp is now wrapped.

This commit is contained in:
Guillaume Blaquiere 2021-10-25 10:18:41 +02:00
parent 4769fc9387
commit 6f4df59c51
1 changed files with 2 additions and 2 deletions

View File

@ -198,10 +198,10 @@ func (f *credentialsFile) tokenSource(ctx context.Context, params CredentialsPar
Ctx: ctx,
URL: f.ServiceAccountImpersonationURL,
Scopes: params.Scopes,
Ts: oauth2.ReuseTokenSource(nil, ts),
Ts: ts,
Delegates: f.Delegates,
}
return imp, nil
return oauth2.ReuseTokenSource(nil, imp), nil
case "":
return nil, errors.New("missing 'type' field in credentials")
default: