Pagesmith.ai

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:

  1. Select User Authentication from integrations
  2. 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

  1. Users register with email and password
  2. Sessions are managed via secure HTTP-only cookies
  3. Protected pages check the session before rendering
  4. The auth middleware handles session validation automatically