Skip to content

Commit

Permalink
Merge pull request #23 from frieser/fix/refresh-token-transport
Browse files Browse the repository at this point in the history
update the expiration time when is in the round trip goroutine
  • Loading branch information
frieser authored Feb 13, 2024
2 parents e4d53e1 + 6c892c6 commit b65cd9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit b65cd9e

Please sign in to comment.