This document outlines the required Supabase configuration for proper user authentication and email verification.
Location: Authentication > Settings
Set the Site URL to your application's URL:
- Development:
http://localhost:3000 - Production:
https://humancompiler-web.vercel.app(or your actual domain)
Add the following URLs to the Redirect URLs list:
- Development:
http://localhost:3000/auth/callback - Production:
https://humancompiler-web.vercel.app/auth/callback
Location: Authentication > Email Templates
The default template should work, but ensure the redirect URL uses the correct variable:
<a href="{{ .ConfirmationURL }}">Confirm your email</a>The ConfirmationURL will automatically use the emailRedirectTo parameter we set in the signUp function.
Location: Authentication > Settings
Ensure the following settings are configured:
- ✅ Enable email confirmations: Should be enabled
- ✅ Disable signup: Should be disabled (to allow new user registrations)
- ✅ Enable email change: Recommended to be enabled
- ✅ Enable password recovery: Recommended to be enabled
Location: Authentication > Users
After fixing the configuration:
- Test user registration with a valid email
- Check if the user appears in the Users table with
email_confirmed_attimestamp after clicking the confirmation link
- User can register with a valid email address
- Confirmation email is received with correct redirect URL
- Clicking the confirmation link redirects to
/auth/callback - User is successfully redirected to dashboard after confirmation
- User can log in with confirmed credentials
- User cannot log in before email confirmation (if email confirmation is required)
-
"Invalid login credentials" error for newly registered users
- Ensure email confirmation is complete
- Check if user exists in Authentication > Users with
email_confirmed_atset
-
Confirmation email shows localhost in production
- Verify
NEXT_PUBLIC_APP_URLenvironment variable is set correctly in production - Check that the correct redirect URLs are configured in Supabase dashboard
- Verify
-
Email not being sent
- Check Supabase project's email rate limits
- Verify email template is not disabled
- Check spam folder
Ensure these environment variables are set:
Development (.env.local):
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
NEXT_PUBLIC_APP_URL=http://localhost:3000Production (Vercel Environment Variables):
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
NEXT_PUBLIC_APP_URL=https://humancompiler-web.vercel.app