You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix refresh token behavior on EXPIRY_MARGIN (#122)
The previous behavior was resulting in the library using an expired
token for a few minutes (for as long as EXPIRY_MARGIN_IN_MINUTES to be
precise), and that is because we had the following timeline:
- now-5min = 2022-12-23T09:57:00Z
- now = 2022-12-23T10:02:00Z
- expiresAt = 2022-12-23T10:05:00Z
- now+5min = 2022-12-23T10:07:00Z
So checking if expiresAt is before now-5min returns true until
now = 2022-12-23T10:09:59Z, which means the calls will fail without the
token being refreshed until that point.
0 commit comments