Example 5
Sign-in and user menu
Magic link sign-in, user menu and the waiting screens of the auth gates. The flow comes from @amadeni/better-auth-kit; the registry only adds the interface, with the kit's texts. Wired to a demo client here so every state can be clicked through.
- SignInCard
- SignInScreen
- UserMenu
- AuthPendingScreen
- AuthShell
Sign-in
Enter an email, link sent, confirm the link from the email. The switch picks the server's answer.
feldbuch.example/login
Fieldbook
User menu
Avatar in the app header, the app's own entries and sign-out. If sign-out fails, the menu stays open and shows the kit's message.
feldbuch.example/app
Fieldbook
Gate waiting screens
What AmadeniAuthProvider shows while the session is renewed, after a loss or while signing out. Wired in via renderPending.
State
feldbuch.example/app/flaechen
Fieldbook
Add to a project
Needs @amadeni/better-auth-kit 0.6.0 or newer. ui-lock brings card, shell, avatar, menu and locale along.
pnpm exec ui-lock add sign-in user-menu auth-screen
// app/login/page.tsx
<SignInScreen authClient={authClient} callbackURL="/"
token={params.get("token")} sentTo={params.get("email")}
verifyError={params.get("error")} productName="…" />
// Provider
<AmadeniAuthProvider … renderPending={renderAuthPendingScreen()} />