Vercel Deployment Authentication Setup Guide
Your Deployed Site
Your test documentation site is now live at:
Step 1: Update Supabase Database
You need to update the domain in your Supabase database to allow authentication from the Vercel domain.
Option A: Using Supabase Dashboard (Recommended)
- Go to your Supabase project: https://supabase.com/dashboard/project/xcihhnfcitjrwbynxmka
- Click on Table Editor in the left sidebar
- Select the
docbuilder_sites
table - Find the row with ID
4d8a53bf-dcdd-48c0-98e0-cd1451518735
- Click the edit icon (pencil)
- Change the
domain
field fromlocalhost:3000
todoc-builder-2znroyb5z-lindsay-1340s-projects.vercel.app
- Click Save
Option B: Using SQL Editor
- Go to your Supabase project dashboard
- Click on SQL Editor in the left sidebar
- Run this SQL command:
-- Update domain for Vercel deployment
UPDATE docbuilder_sites
SET domain = 'doc-builder-2znroyb5z-lindsay-1340s-projects.vercel.app'
WHERE id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
-- Verify the update
SELECT id, domain, name
FROM docbuilder_sites
WHERE id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
Step 2: Test Authentication Flow
Once the database is updated, test the authentication:
- Visit your site: https://doc-builder-2znroyb5z-lindsay-1340s-projects.vercel.app
- You should be automatically redirected to the login page
- Login with your test credentials:
- Email:
testuser@example.com
- Password:
testpass123
- Email:
- After successful login, you should see the test documentation content
Step 3: Verify Authentication Features
What Should Work:
- Automatic redirect to login for unauthenticated users
- No content flash before redirect (fixed with CSS)
- Successful login with valid credentials
- Access to documentation after authentication
- Logout functionality
- Session persistence across page refreshes
Things to Check:
- Network Tab: Look for Supabase API calls to verify authentication
- Console: Check for any JavaScript errors
- Browser Cache: Clear cache if you see stale content
- Session Storage: Verify Supabase JWT token is stored
Troubleshooting
If Login Fails:
- Verify the domain was updated correctly in Supabase
- Check browser console for errors
- Ensure cookies are enabled
- Try incognito/private browsing mode
If Content Doesn't Show After Login:
- Clear browser cache completely
- Check console for JavaScript errors
- Verify the
authenticated
class is added to body element - Ensure JavaScript is enabled
Next Steps
After successful testing, you can:
Create Production Deployment:
# Deploy to production URL vercel --prod
Add Custom Domain:
- Configure custom domain in Vercel
- Update Supabase database with new domain
Add More Users:
# Use CLI command npx @knowcode/doc-builder auth:add-user production-email@example.com
Deploy Multiple Sites:
- Each site gets unique site_id
- Users can have access to multiple sites
- Central authentication system
Security Notes
- The Supabase URL and anon key are public (by design)
- Security is enforced through Row Level Security (RLS) policies
- JWT tokens expire and auto-refresh
- Password hashing is handled by Supabase (bcrypt)
Important URLs
- Live Site: https://doc-builder-2znroyb5z-lindsay-1340s-projects.vercel.app
- Supabase Dashboard: https://supabase.com/dashboard/project/xcihhnfcitjrwbynxmka
- Vercel Dashboard: https://vercel.com/dashboard
Status: Ready for database update and testing
Next Action: Update the domain in Supabase database