Skip to content
rw3iss Auth

AuthLoading

atom @rw3iss/auth-client/preact/atoms/AuthLoading framework-adapters/preact/components/atoms/AuthLoading.tsx ↗

Renders fallback while the AuthClient is still bootstrapping (first network call, token restore, /auth/me confirmation). After the snapshot reports ready === true, renders children.

Drop this inside your app shell so the first paint doesn’t flash the anonymous UI before the cached session restores.

Usage

import { AuthLoading } from '@rw3iss/auth-client/preact/atoms';
<AuthLoading
children={<></>}
/>

Props

NameTypeDescription
childrenComponentChildren(required)
fallbackComponentChildrenWhat to render while loading. Default: a centered spinner.
clientAuthClient