General
Troubleshooting

Authentication

Learn about authentication troubles and their solutions.

I can't sign up or sign in

Likely you forgot to apply the migrations or the DATABASE_URL connection string is missing.

  1. Make sure your database is set up and migrations are applied: npm run db:migrate or npm run db:push
  2. Check that DATABASE_URL is set in your .env file
  3. Verify that BETTER_AUTH_SECRET is correctly configured

When I sign in on production it redirects me to localhost

Likely you have set the wrong redirect in your OAuth provider's settings. Make sure the redirect URLs in your OAuth provider settings match your production domain. The baseUrl in config/app.config.ts automatically uses NEXT_PUBLIC_SITE_URL if set, otherwise it falls back to the request URL.

OAuth provider not working

If OAuth sign-in isn't working:

  1. Check that your OAuth app credentials are correct in .env (e.g., GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET)
  2. Verify the redirect URLs match in both your OAuth provider settings and your app configuration
  3. Make sure NEXT_PUBLIC_SITE_URL is set to your production URL in production (or ensure baseUrl in config/app.config.ts is correct)
  4. Check the browser console and server logs for error messages