Supabase requires email confirmation by default, which blocks testing during development.
- Go to https://supabase.com/dashboard
- Select your project
- Navigate to: Authentication → Providers
- Click on Email provider
- Find "Confirm email" toggle
- Turn it OFF
- Click Save
✅ Pros: Simple, no code changes needed
❌ Cons: Requires dashboard access, affects all users
The registration code already handles both scenarios:
- ✅ If email confirmation is disabled: User is auto-logged in → Redirected to master password setup
- ✅ If email confirmation is enabled: Shows helpful error message with instructions
When you register and email confirmation is enabled, you'll see:
Email confirmation is enabled. Please check your email to confirm your account,
or disable email confirmation in Supabase Dashboard:
Authentication → Providers → Email → Confirm email (toggle OFF)
If you want to auto-confirm emails programmatically, you would need to:
- Create a server-side API route
- Use the
SUPABASE_SERVICE_ROLE_KEYto bypass RLS - Update the user's
email_confirmed_atfield
This is NOT recommended because it requires exposing admin credentials.
Use Solution 1 - Disable email confirmation in Supabase Dashboard
- ✅ Keep email confirmation ENABLED
- ✅ Users will receive confirmation emails
- ✅ This prevents spam and ensures valid email addresses
After disabling email confirmation in Supabase:
-
Register a new user:
Email: test@example.com Password: Password123! -
Expected Flow:
Register → Auto Login → Master Password Setup → Vault ✓ ✓ ✓ ✓ -
What you'll see:
- ✅ "Account created successfully! Redirecting to master password setup..."
- ✅ Automatic redirect to
/master-password?setup=true - ✅ Master password setup form with password visibility toggles
- ✅ After setting master password → Redirect to
/vault
✅ Registration page (app/(auth)/register/page.tsx):
- Handles both email confirmation scenarios
- Shows clear error messages
- Auto-redirects when confirmation is disabled
✅ Login API (app/api/auth/login/route.ts):
- Checks for master password
- Redirects to setup if not set
✅ Master Password page (app/(auth)/master-password/page.tsx):
- Password visibility toggles
- Setup vs unlock modes
- Proper error handling
- Disable email confirmation in Supabase Dashboard (Solution 1)
- Clear browser cookies for localhost:3000
- Register a new user (use a new email address)
- Test the complete flow:
- Registration → Master Password Setup → Vault Access
- ✅ Verify the setting was saved in Supabase
- ✅ Try with a completely new email address
- ✅ Clear browser cookies and cache
- ✅ Check Supabase logs for any errors
- Contact your project admin
- Or use a test Supabase project where you have admin access
Ready to test! Once you disable email confirmation in Supabase, the entire flow will work seamlessly.