Internal DocumentationArchived DocumentationDo dev legacyArchiveClerk migration

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

  1. SSL Certificate Issues with clerk.auth.do.dev

    • Error: ERR_SSL_VERSION_OR_CIPHER_MISMATCH
    • The custom Clerk domain has SSL/TLS configuration issues
  2. Missing Environment Variables

    • NEXT_PUBLIC_PRIMARY_AUTH_URL not set
    • Clerk configuration incomplete
  3. Component Rendering Failures

    • When Clerk fails to load, components may not render fallback UI

Solutions

  1. 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
  2. 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
  3. Redeploy the application

Permanent Fix

  1. 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
  2. Update Clerk Dashboard:

    • Add clerk.auth.do.dev as a satellite domain
    • Configure CORS settings
    • Verify domain ownership
  3. 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

  1. Added error handling to AuthStatusWrapper component
  2. Improved Clerk configuration to handle missing custom domain
  3. Added fallback UI when auth system fails
  4. Fixed default localhost ports from 3000 to 3005

Testing

  1. Check browser console for errors
  2. Look for debug logs: [useAuth] Clerk auth state:
  3. Verify environment variables in Vercel dashboard
  4. 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

On this page