diff --git a/api/api.go b/api/api.go index e521b4d..2ae8e67 100644 --- a/api/api.go +++ b/api/api.go @@ -278,7 +278,7 @@ func (api *Client) ExchangeAuth() (*TokenPair, error) { func (api *Client) RefreshTokenIfExpired() error { now := time.Now() - if now.After(api.options.ExpirationAt.Add(-time.Second*2)) { + if now.After(api.options.ExpirationAt) || now.Equal(api.options.ExpirationAt){ _, err := api.RefreshToken() if err != nil { return err