Documentation Index
Fetch the complete documentation index at: https://docs.auction-rise.com/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
The template uses Supabase Auth with email/password sign-in, email verification, and password reset. Session management runs through a Next.js middleware-style proxy that refreshes tokens and enforces route protection on every request.Auth Routes
| Route | Purpose |
|---|---|
/auth/login | Sign in page |
/auth/register | Sign up page |
/auth/reset-password | Request password reset email |
/auth/reset-password/confirm | Set new password (after clicking email link) |
/auth/callback | OAuth / email verification callback |
/auth/error | Auth error display |
Email Verification
Email confirmation is enabled by default (enable_confirmations = true in supabase/config.toml). After registration, users receive a verification email. The RegisterForm shows a “check your email” state with a resend option. The LoginForm handles the email_not_confirmed error with an inline resend banner.
During local development, Supabase routes emails through Inbucket (http://localhost:54324) so you never need real SMTP credentials to test the flow.
Three Supabase Client Patterns
The app exposes three client patterns, all re-exported from@/lib/supabase:
SUPABASE_SERVICE_ROLE_KEY and should only be used in server actions or API routes for operations that need to bypass Row Level Security (e.g., creating users, reading across workspaces).
Session Management
proxy.ts runs on every request (via Next.js middleware) and does two things:
- Refreshes the Supabase session — calls
supabase.auth.getUser()so the token is kept alive and written back to cookies. - Enforces route protection — redirects unauthenticated users away from protected routes, and redirects authenticated users away from auth routes.
saas.config.ts:
protectedRoutes. Add paths that begin with a protected prefix but handle their own auth (e.g., public invite acceptance) to publicRouteOverrides.
Auth Context (Client Components)
Wrap your app withAuthProvider (already done in the root layout) and read auth state anywhere with useAuth():
isSuperAdmin is fetched from profiles.is_super_admin on sign-in. The provider also handles automatic token refresh and listens to auth state changes.
Password Reset Flow
User clicks email link
Lands on
/auth/callback, which exchanges the token and redirects to /auth/reset-password/confirm.Environment Variables
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL | Yes | Your Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Yes | Supabase anon/public key |
SUPABASE_SERVICE_ROLE_KEY | Yes | Service role key (server-only) |