Authentication
Add user login and registration to your Pagesmith site.
Add user authentication to your site for gated content, admin dashboards, or member-only areas.
User Authentication
Full email/password authentication with session management, powered by BetterAuth.
Requires: SSR enabled and D1 database on your site.
Setup:
- Select User Authentication from integrations
- The Auth Secret is auto-generated and the Site URL is auto-detected
What gets added:
- Login and registration pages
- Session management with secure cookies
- Auth middleware for protecting pages
- Server and client auth utilities
- Database schema for user accounts
What You Can Build
- Admin dashboards — restrict access to site owners
- Member areas — gated content for logged-in users
- Client portals — private pages for specific clients
- User accounts — personalized experiences
Tell the AI what you need:
Add a login page and protect the /dashboard route
Create a members-only area at /members
Add user registration with email verification
How It Works
- Users register with email and password
- Sessions are managed via secure HTTP-only cookies
- Protected pages check the session before rendering
- The auth middleware handles session validation automatically