From 6c892c66302dc10a4dd2621e08fecc8355a438e0 Mon Sep 17 00:00:00 2001 From: "hector.molano.next@bbva.com" Date: Tue, 13 Feb 2024 16:06:45 +0100 Subject: [PATCH] update the expiration time when is in the round trip goroutine --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index 89962b6..756fcdb 100644 --- a/client.go +++ b/client.go @@ -43,7 +43,7 @@ func (t refreshTokenTransport) RoundTrip(req *http.Request) (*http.Response, err if err != nil { return nil, err } - t.cli.expiration.Add(time.Duration(t.cli.token.RefreshExpires-60) * time.Second) + t.cli.expiration = t.cli.expiration.Add(time.Duration(t.cli.token.RefreshExpires-60) * time.Second) } t.cli.m.Unlock() req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", t.cli.token.Access))