(ctx context.Context, cfg *oauth2.Config, token *oauth2.Token, userInfoURL string)
| 536 | } |
| 537 | |
| 538 | func fetchGoogleUserInfo(ctx context.Context, cfg *oauth2.Config, token *oauth2.Token, userInfoURL string) (*googleUserInfo, error) { |
| 539 | client := cfg.Client(ctx, token) |
| 540 | resp, err := client.Get(userInfoURL) |
| 541 | if err != nil { |
| 542 | return nil, err |
| 543 | } |
| 544 | defer resp.Body.Close() |
| 545 | |
| 546 | var info googleUserInfo |
| 547 | if err := json.NewDecoder(resp.Body).Decode(&info); err != nil { |
| 548 | return nil, err |
| 549 | } |
| 550 | return &info, nil |
| 551 | } |
| 552 | |
| 553 | // HandleDashboardStats returns the workspace-level aggregates for the |
| 554 | // redesigned dashboard's stats strip. Accepts ?window=N (days) to vary |
no test coverage detected