MCPcopy
hub / github.com/pocketbase/pocketbase / FetchRawUserInfo

Method FetchRawUserInfo

tools/auth/linear.go:100–111  ·  view source on GitHub ↗

FetchRawUserInfo implements Provider.FetchRawUserInfo interface method. Linear doesn't have a UserInfo endpoint and information on the user is retrieved using their GraphQL API (https://developers.linear.app/docs/graphql/working-with-the-graphql-api#queries-and-mutations)

(token *oauth2.Token)

Source from the content-addressed store, hash-verified

98// Linear doesn't have a UserInfo endpoint and information on the user
99// is retrieved using their GraphQL API (https://developers.linear.app/docs/graphql/working-with-the-graphql-api#queries-and-mutations)
100func (p *Linear) FetchRawUserInfo(token *oauth2.Token) ([]byte, error) {
101 query := []byte(`{"query": "query Me { viewer { id displayName name email avatarUrl active } }"}`)
102 bodyReader := bytes.NewReader(query)
103
104 req, err := http.NewRequestWithContext(p.ctx, "POST", p.userInfoURL, bodyReader)
105 if err != nil {
106 return nil, err
107 }
108 req.Header.Set("Content-Type", "application/json")
109
110 return p.sendRawUserInfoRequest(req, token)
111}

Callers 1

FetchAuthUserMethod · 0.95

Calls 3

NewReaderMethod · 0.80
SetMethod · 0.65

Tested by

no test coverage detected