oauth2: replace a magic number with AuthStyleUnknown

Change-Id: I7e08428b87f141fa6d2932b7d60b3e726a454986
GitHub-Last-Rev: 0aef667f234844d4784c92b9100054041b343840
GitHub-Pull-Request: golang/oauth2#646
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/496075
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Mason Elmore 2025-04-17 21:54:48 +00:00 committed by Gopher Robot
parent 696f7b3128
commit 2d34e3091b

View File

@ -216,7 +216,7 @@ func cloneURLValues(v url.Values) url.Values {
}
func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, v url.Values, authStyle AuthStyle, styleCache *AuthStyleCache) (*Token, error) {
needsAuthStyleProbe := authStyle == 0
needsAuthStyleProbe := authStyle == AuthStyleUnknown
if needsAuthStyleProbe {
if style, ok := styleCache.lookupAuthStyle(tokenURL); ok {
authStyle = style