From cadae684d69a16793dc56d43a54fd27c970064f7 Mon Sep 17 00:00:00 2001 From: Kristof Daja Date: Sun, 27 Sep 2020 15:33:46 +0200 Subject: [PATCH] (HOTFIX) Auth error fix --- client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client.go b/client.go index bab33d5..88853e7 100644 --- a/client.go +++ b/client.go @@ -151,8 +151,8 @@ func (c *Client) Initialise() error { // AuthByCredentials authenticates to Taiga using the provided basic credentials func (c *Client) AuthByCredentials(credentials *Credentials) error { - if !c.isInitialised { - return c.Initialise() + if err := c.Initialise(); err != nil { + return err } if len(credentials.Type) <= 1 { @@ -170,8 +170,8 @@ func (c *Client) AuthByCredentials(credentials *Credentials) error { // AuthByToken authenticates to Taiga using provided Token by requesting users/me func (c *Client) AuthByToken(tokenType, token string) error { - if !c.isInitialised { - return c.Initialise() + if err := c.Initialise(); err != nil { + return err } c.TokenType = tokenType c.Token = token