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
When the ceiling is reached, `useAuth0()` reflects the expired state on the next render:
1636
+
When the ceiling is reached, `useAuth0()` reflects the expired state on the next call to `getAccessTokenSilently`, `getUser`, or `getIdTokenClaims` — there is no background timer or automatic re-check:
1637
1637
1638
1638
- `isAuthenticated` becomes `false`
1639
1639
- `user` becomes `undefined`
1640
1640
- `getAccessTokenSilently()` returns `undefined` (no error thrown)
1641
1641
1642
-
If your routes are wrapped with `withAuthenticationRequired`, no code changes are required — the state change triggers a redirect to login automatically. Components that call `getAccessTokenSilently()` imperatively (e.g. in a click handler or `useEffect`) need an explicit null check; see [Upgrading existing apps](#upgrading-existing-apps) below.
1642
+
If your routes are wrapped with `withAuthenticationRequired`, no code changes are required — the next time a component calls `getAccessTokenSilently` or `getUser`, the state updates and the HOC redirects to login. A user sitting on a page that makes no token or user calls will remain authenticated in the React state until the next such call.
1643
1643
1644
1644
```jsx
1645
-
//This component already handles the session_expiry ceiling with no changes.
1646
-
//When the ceiling passes, isAuthenticated becomes false and the HOC redirects to login.
1645
+
//When a token or user call occurs after the ceiling, isAuthenticated becomes false
`session_expiry` is a standard ID token claim and is available via `getIdTokenClaims()`:
1652
+
`session_expiry` is a standard ID token claim and is available via `getIdTokenClaims()`. Note that `getIdTokenClaims()` returns `undefined` once the ceiling is reached — this is useful for displaying time remaining before expiry, not for detecting expiry itself.
0 commit comments