Amadeni

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.

Server answer

Jump to

Cooldown is 10 s in the demo, 30 s by default in the kit.

feldbuch.example/login
Fieldbook

Sign-in

Welcome back

Enter your email address and open the sign-in link from your inbox. No password needed.

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.

Sign-out

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()} />