1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Make sure integrations are configured before to make any HTTP requests

This commit is contained in:
Frédéric Guillot 2018-04-29 17:58:09 -07:00
parent 31da4db14f
commit 7a1653a2e9
5 changed files with 20 additions and 4 deletions

View file

@ -24,6 +24,10 @@ type Client struct {
// AddEntry sends a link to Wallabag.
func (c *Client) AddEntry(link, title string) error {
if c.baseURL == "" || c.clientID == "" || c.clientSecret == "" || c.username == "" || c.password == "" {
return fmt.Errorf("wallabag: missing credentials")
}
accessToken, err := c.getAccessToken()
if err != nil {
return err