Skip to content

Commit a3ac9f5

Browse files
committed
refactor: goauth: simplify code
1 parent b377fb5 commit a3ac9f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

credentials_oauth2.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ func (oc *CredentialsOAuth2) NewToken(ctx context.Context) (*oauth2.Token, error
161161
} else if oc.IsGrantType(authutil.GrantTypeAccountCredentials) {
162162
return authutil.NewTokenAccountCredentials(ctx, oc.Endpoint.TokenURL, oc.ClientID, oc.ClientSecret, oc.TokenBodyOpts)
163163
} else if oc.IsGrantType(authutil.GrantTypeClientCredentials) {
164-
config := oc.ConfigClientCredentials()
165-
return authutil.ClientCredentialsToken(ctx, config)
164+
return authutil.ClientCredentialsToken(ctx, oc.ConfigClientCredentials())
165+
// config := oc.ConfigClientCredentials()
166166
// return config.Token(ctx)
167167
} else if oc.IsGrantType(authutil.GrantTypePassword) {
168168
// cfg := oc.Config()

0 commit comments

Comments
 (0)