MCPcopy
hub / github.com/writefreely/writefreely / buildLoginURL

Method buildLoginURL

oauth_writeas.go:41–53  ·  view source on GitHub ↗
(state string)

Source from the content-addressed store, hash-verified

39}
40
41func (c writeAsOauthClient) buildLoginURL(state string) (string, error) {
42 u, err := url.Parse(c.AuthLocation)
43 if err != nil {
44 return "", err
45 }
46 q := u.Query()
47 q.Set("client_id", c.ClientID)
48 q.Set("redirect_uri", c.CallbackLocation)
49 q.Set("response_type", "code")
50 q.Set("state", state)
51 u.RawQuery = q.Encode()
52 return u.String(), nil
53}
54
55func (c writeAsOauthClient) exchangeOauthCode(ctx context.Context, code string) (*TokenResponse, error) {
56 form := url.Values{}

Callers

nothing calls this directly

Calls 1

StringMethod · 0.80

Tested by

no test coverage detected