Must be rendered inside an <AuthProvider> and an
<ApplicationStoreProvider>.
Keeps the in-memory token and cookie in sync with the OIDC provider.
react-oidc-context's UserManager already renews the access token
automatically before it expires (automaticSilentRenew, on by default),
and internally listens to its own accessTokenExpiring/accessTokenExpired
events to do so. This component must NOT also call auth.signinSilent()
on those same events — doing so previously caused two concurrent
signinSilent() calls per renewal, racing to redeem the same (single-use)
refresh token against the IdP, which surfaced as an intermittent 400 from
the token endpoint and — because the losing call's failure handler cleared
the token outright — as 401s on API calls right around every token
expiry, even when the other, winning renewal had actually succeeded.
Instead, we only react passively to the outcome of the library's own
renewal: sync the token when it changes, and clear it if the library
reports the renewal ultimately failed (SilentRenewError).
Must be rendered inside an
<AuthProvider>and an<ApplicationStoreProvider>.Keeps the in-memory token and cookie in sync with the OIDC provider.
react-oidc-context'sUserManageralready renews the access token automatically before it expires (automaticSilentRenew, on by default), and internally listens to its ownaccessTokenExpiring/accessTokenExpiredevents to do so. This component must NOT also callauth.signinSilent()on those same events — doing so previously caused two concurrentsigninSilent()calls per renewal, racing to redeem the same (single-use) refresh token against the IdP, which surfaced as an intermittent400from the token endpoint and — because the losing call's failure handler cleared the token outright — as401s on API calls right around every token expiry, even when the other, winning renewal had actually succeeded.Instead, we only react passively to the outcome of the library's own renewal: sync the token when it changes, and clear it if the library reports the renewal ultimately failed (
SilentRenewError).