Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hickford committed Mar 5, 2023
1 parent 8c7208a commit fa1978c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 0 additions & 6 deletions deviceauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
5 changes: 4 additions & 1 deletion oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fa1978c

Please sign in to comment.