Sign Up
User registration with email verification, personal account creation, and optional terms acceptance.
Sign Up Flow
What happens when a user registers.
New users register through the sign up page, which creates a user record and a personal account. Email verification is required by default.
Page location: apps/web/app/[locale]/auth/sign-up/page.tsx Route: /auth/sign-up
Registration Form
The sign up form collects name, email, and password.

Configuration
apps/web/.env.local
# Enable email/password registration (default: true)NEXT_PUBLIC_AUTH_PASSWORD=trueComponent
The sign up form is rendered by SignUpMethodsContainer:
packages/auth/src/components/sign-up-methods-container.tsx
<SignUpMethodsContainer paths={{ appHome: '/dashboard', }} providers={{ password: true, magicLink: false, oAuth: ['google'], }} displayTermsCheckbox={true}/>Email Verification
After registration, users receive a verification email. They must click the link to activate their account.
Configuration
Email verification is enabled by default in the Better Auth configuration:
packages/better-auth/src/auth.ts
emailAndPassword: { enabled: true, requireEmailVerification: true, // Require verification},emailVerification: { sendOnSignUp: true, // Send email automatically autoSignInAfterVerification: true, // Sign in after verifying},Verification Flow
- User submits registration form
- User record is created with
emailVerified: false - Verification email is sent with a secure link
- User clicks link and is redirected to
/auth/verify - Email is marked as verified
- User is automatically signed in (if
autoSignInAfterVerificationis true)
Email Template
The verification email is sent using your configured mailer. Customize the template at:
packages/better-auth/src/emails/send-verification-email.tsAccount Creation
When a user registers, the kit automatically creates:
- User record - Core identity with email, name, password hash
- Personal account - Default workspace for the user
The personal account allows users to use the app immediately without creating an organization. Users can later create or join organizations.
Database Records
-- User tableINSERT INTO users (id, email, name, email_verified, created_at)VALUES ('user_123', 'user@example.com', 'John Doe', false, NOW());-- Account table (personal workspace)INSERT INTO accounts (id, name, is_personal_account, primary_owner_user_id)VALUES ('account_123', 'Personal', true, 'user_123');Social Provider Registration
Users can also register via social providers (Google, GitHub). When signing in with a social provider for the first time, an account is automatically created.
Social registration:
- Does not require a password
- Email is automatically verified (trusted from provider)
- Profile data (name, avatar) is imported from the provider
See Sign In > Social Provider Sign In for configuration.
Magic Link Registration
When magic link is enabled, users can register by simply entering their email. A link is sent that both verifies the email and signs them in.
apps/web/.env.local
NEXT_PUBLIC_AUTH_MAGIC_LINK=truePost-Registration
After successful registration and email verification, users are redirected to their dashboard:
// Default redirect pathconst redirectPath = process.env.NEXT_PUBLIC_APP_HOME_PATH ?? '/dashboard';Customizing the Redirect
To change where users land after registration, set the environment variable:
apps/web/.env.local
NEXT_PUBLIC_APP_HOME_PATH=/onboardingProgrammatic Registration
For custom registration flows, use the auth client directly:
'use client';import { authClient } from '@kit/better-auth/client';async function handleSignUp(name: string, email: string, password: string) { const result = await authClient.signUp.email({ name, email, password, }); if (result.error) { console.error(result.error.message); return; } // Show "check your email" message alert('Please check your email to verify your account');}Adding Terms Acceptance
To require users to accept terms of service, the sign up form includes an optional checkbox:
packages/auth/src/components/terms-and-conditions-form-field.tsx
<TermsAndConditionsFormField termsPath="/terms" privacyPath="/privacy"/>Configure the paths to your terms and privacy policy pages.
Validation Rules
The registration form enforces these validations:
| Field | Rules |
|---|---|
| Name | Required, 1-100 characters |
| Required, valid email format | |
| Password | Required, minimum 8 characters |
Custom Validation
To add custom password requirements, modify the Zod schema in the sign up form component.
Common Issues
"Email already exists" Error
The email is already registered. Direct users to the sign in page or password reset.
Verification Email Not Received
- Check spam/junk folder
- Verify mailer configuration
- Check that
sendOnSignUpistruein auth config - In development, check the console for logged URLs
User Created but Can't Sign In
Email verification is likely pending. Check the emailVerified field in the database.
Previous: Sign In ← | Next: Password Reset →