On the client, is there a way to trigger token refresh behavior if access token is deemed expired locally?
i.e. to refresh & retry without getting the 401 from server?
If you monitor token expiration, you can call the BearerAuthProvider.refreshToken method (if the token has expired) to refresh it and save a new one in the storage.
u
ursus
04/24/2026, 8:15 AM
will it be "thread" safe if concurrent requests are hitting it & do retries etc? basically exactly how does the refresh pipeline behave if triggered by response code?
a
Aleksei Tirman [JB]
04/24/2026, 8:37 AM
Unfortunately, no. The storage update is synchronized, but the request queue, which prevents double-refresh, is implemented in a higher-level private function.
u
ursus
04/24/2026, 8:39 AM
yea I figured, hence trying to somehow trigger the singular refresh pipeline