ProtectedRoute
Render children only if the caller is authenticated. While the
AuthClient is still bootstrapping, renders the loading fallback
(default: an inline <AuthLoading/>-style placeholder).
Anonymous state renders the fallback — typically a redirect
component from your router, or an inline “please sign in” view.
The component itself does not navigate; that’s a router concern.
Usage
<ProtectedRoute fallback={
Usage
import { ProtectedRoute } from '@rw3iss/auth-client/preact/atoms';
<ProtectedRoute children={<></>}/>Props
| Name | Type | Description |
|---|---|---|
children | ComponentChildren | (required) |
fallback | ComponentChildren | Rendered when the user is anonymous / offline / session expired. |
loading | ComponentChildren | Rendered while AuthClient is still bootstrapping. |
client | AuthClient |