Authentication with Better Auth
Email/password authentication backed by the project database, with protected routes and server-side session checks.
Auth Offline
Current Session
Auth offline
Set DATABASE_URL, BETTER_AUTH_SECRET, and BETTER_AUTH_URL to enable Better Auth.
Protected Routes
Implementation Notes
Server Hook
svelteKitHandler handles Better Auth routes and the hook populates event.locals.user.
Database
Auth requires the same Postgres connection used by the component demos.
Cookies
sveltekitCookies is configured so server actions/client calls set auth cookies correctly.