- On localhost: verification links went to
/verify?email=...✅ - On Vercel: verification links went to
/verify-email?email=...❌ - Now: Both use
/verify?email=...✅
Add this environment variable to your Vercel deployment:
NEXT_PUBLIC_BASE_URL=https://your-vercel-domain.vercel.appImportant: Replace your-vercel-domain.vercel.app with your actual Vercel domain.
- ❌ Deleted
/app/verify-email/page.tsx - ❌ Deleted
/app/api/auth/verify-email/route.ts - ✅ Kept only
/app/verify/page.tsxand/app/api/auth/verify/route.ts
async redirects() {
return [
{
source: '/verify-email',
destination: '/verify',
permanent: true
}
];
},- All emails now include clickable "Verify Now" buttons
- Links point to
/verify?email=...&code=... - Works with both Resend and SMTP fallback
- Handles
codeparameter from URL (auto-verification) - Supports manual code entry
- Single source of truth for verification
- Local (.env.local):
NEXT_PUBLIC_BASE_URL=http://localhost:3000 - Vercel:
NEXT_PUBLIC_BASE_URL=https://your-domain.vercel.app
- Register a new user
- Check email - should have "Verify Now" button
- Click button - should go to
/verify?email=...&code=... - Should auto-verify and redirect to signin
- Works identically on localhost and Vercel
- Email links always point to
/verify?email=...in both localhost and Vercel - Only one verification page (
/verify) - No more
/verify-email(deleted + redirect added) - Localhost and production behave identically
- Enhanced logging for debugging on Vercel