TokenExpiryCountdown
Live countdown to the cached access token’s expiry. Re-renders once per second while the user is authenticated. After expiry, shows “expired” until the auto-refresh path mints a new token.
The countdown reads cachedClaims.exp from the AuthClient snapshot,
NOT a separate timer — so it stays consistent across tabs and
survives refresh/cross-tab token updates without manual coordination.
Primarily a debug/visibility component; useful in admin dashboards.
Usage
import { TokenExpiryCountdown } from '@rw3iss/auth-client/preact/atoms';
<TokenExpiryCountdown />Props
| Name | Type | Description |
|---|---|---|
client | AuthClient | |
className | string | |
format | (secondsRemaining: number) => string | Override the format. Receives whole seconds remaining (may be negative). |