FetchRawUserInfo implements Provider.FetchRawUserInfo interface. monday.com doesn't have a UserInfo endpoint and information on the user is retrieved using their GraphQL API (https://developer.monday.com/api-reference/reference/me#queries)
(token *oauth2.Token)
| 97 | // monday.com doesn't have a UserInfo endpoint and information on the user |
| 98 | // is retrieved using their GraphQL API (https://developer.monday.com/api-reference/reference/me#queries) |
| 99 | func (p *Monday) FetchRawUserInfo(token *oauth2.Token) ([]byte, error) { |
| 100 | query := []byte(`{"query": "query { me { id enabled name email is_verified photo_small }}"}`) |
| 101 | bodyReader := bytes.NewReader(query) |
| 102 | |
| 103 | req, err := http.NewRequestWithContext(p.ctx, "POST", p.userInfoURL, bodyReader) |
| 104 | if err != nil { |
| 105 | return nil, err |
| 106 | } |
| 107 | req.Header.Set("Content-Type", "application/json") |
| 108 | |
| 109 | return p.sendRawUserInfoRequest(req, token) |
| 110 | } |
no test coverage detected