From dfa4fcb54e6c6e8e04fd7a62cf785e539a293db6 Mon Sep 17 00:00:00 2001 From: surdeus Date: Tue, 30 Jan 2024 23:33:40 +0300 Subject: [PATCH] ... --- api/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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