Skip to content

Commit

Permalink
Use authorization header to pass token
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaos committed Dec 30, 2022
1 parent cde69dc commit c74808a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/todoist.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ func (c *Client) doApi(ctx context.Context, method string, uri string, params ur
}
u.Path = path.Join(u.Path, uri)

params.Add("token", c.config.AccessToken)

c.Log("config: %#v", c.config)

var body io.Reader
Expand All @@ -61,6 +59,7 @@ func (c *Client) doApi(ctx context.Context, method string, uri string, params ur
}

req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req.Header.Set("Authorization", "Bearer "+c.config.AccessToken)
req = req.WithContext(ctx)

c.Log("request: %#v", req)
Expand Down

0 comments on commit c74808a

Please sign in to comment.