From fa1978c7bb3d159eb1245cb38a516e5265aa5b3d Mon Sep 17 00:00:00 2001 From: M Hickford Date: Sun, 5 Mar 2023 22:33:04 +0000 Subject: [PATCH] address comment https://go-review.googlesource.com/c/oauth2/+/450155/comment/a17553ee_612942c0/ --- deviceauth.go | 6 ------ oauth2.go | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/deviceauth.go b/deviceauth.go index 431cdd86d..13eba963c 100644 --- a/deviceauth.go +++ b/deviceauth.go @@ -89,11 +89,5 @@ func retrieveDeviceAuth(ctx context.Context, c *Config, v url.Values) (*DeviceAu } _ = json.Unmarshal(body, &da.raw) - - // Azure AD supplies verification_url instead of verification_uri - if da.VerificationURI == "" { - da.VerificationURI, _ = da.raw["verification_url"].(string) - } - return da, nil } diff --git a/oauth2.go b/oauth2.go index 231e6121d..6e6fee53d 100644 --- a/oauth2.go +++ b/oauth2.go @@ -270,7 +270,10 @@ func (c *Config) Poll(ctx context.Context, da *DeviceAuthResponse, opts ...AuthC return tok, nil } - e, _ := err.(*RetrieveError) + e, ok := err.(*RetrieveError) + if !ok { + return nil, err + } switch e.ErrorCode { case errSlowDown: interval += 5