Authentication Troubleshooting Guide
Problem: Auth buttons not showing in production
Symptoms
- No "Get Started" or "Sign In" buttons in the navbar
- Console errors about clerk.auth.do.dev SSL issues
- Empty space where auth buttons should be
Root Causes
-
SSL Certificate Issues with clerk.auth.do.dev
- Error:
ERR_SSL_VERSION_OR_CIPHER_MISMATCH - The custom Clerk domain has SSL/TLS configuration issues
- Error:
-
Missing Environment Variables
NEXT_PUBLIC_PRIMARY_AUTH_URLnot set- Clerk configuration incomplete
-
Component Rendering Failures
- When Clerk fails to load, components may not render fallback UI
Solutions
Quick Fix (Recommended for immediate deployment)
-
Disable custom Clerk domain in Vercel environment variables:
# Comment out or remove these: # NEXT_PUBLIC_CLERK_DOMAIN=auth.do.dev # NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in # NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up -
Ensure these are set:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_Y2xlcmsuZG8uZGV2JA CLERK_SECRET_KEY=sk_live_your-secret-key NEXT_PUBLIC_PRIMARY_AUTH_URL=https://auth.do.dev -
Redeploy the application
Permanent Fix
-
Fix SSL certificate for clerk.auth.do.dev:
- Ensure valid SSL certificate is installed
- Support TLS 1.2 or higher
- Check DNS records point to correct server
-
Update Clerk Dashboard:
- Add clerk.auth.do.dev as a satellite domain
- Configure CORS settings
- Verify domain ownership
-
Re-enable custom domain once SSL is fixed:
NEXT_PUBLIC_CLERK_DOMAIN=auth.do.dev NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
Code Changes Made
- Added error handling to
AuthStatusWrappercomponent - Improved Clerk configuration to handle missing custom domain
- Added fallback UI when auth system fails
- Fixed default localhost ports from 3000 to 3005
Testing
- Check browser console for errors
- Look for debug logs:
[useAuth] Clerk auth state: - Verify environment variables in Vercel dashboard
- Test with curl:
curl -I https://clerk.auth.do.dev
Monitoring
Add these to your monitoring:
- SSL certificate expiration for clerk.auth.do.dev
- Clerk API availability
- Auth component render failures
- User authentication success rate