forked from Mirrors/oauth2
fix: wrong if condition, improve error message.
This commit is contained in:
parent
2a8fe80698
commit
07d40c0597
|
@ -184,8 +184,8 @@ func (f *credentialsFile) tokenSource(ctx context.Context, params CredentialsPar
|
||||||
}
|
}
|
||||||
return cfg.TokenSource(ctx)
|
return cfg.TokenSource(ctx)
|
||||||
case impersonatedServiceAccount:
|
case impersonatedServiceAccount:
|
||||||
if f.ServiceAccountImpersonationURL != "" && f.SourceCredentials == nil {
|
if f.ServiceAccountImpersonationURL != "" || f.SourceCredentials == nil {
|
||||||
return nil, errors.New("missing 'source_credentials' field in credentials")
|
return nil, errors.New("missing 'source_credentials' field or 'service_account_impersonation_url' in credentials")
|
||||||
}
|
}
|
||||||
|
|
||||||
ts, err := f.SourceCredentials.tokenSource(ctx, params)
|
ts, err := f.SourceCredentials.tokenSource(ctx, params)
|
||||||
|
|
Loading…
Reference in New Issue