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.
- Make sure your database is set up and migrations are applied:
npm run db:migrate:dev - Check that
DATABASE_URLis set in your.envfile - Verify that
BETTER_AUTH_SECRETis correctly configured - The Prisma client is automatically generated during migrations
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:
- Check that your OAuth app credentials are correct in
.env(e.g.,GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET) - Verify the redirect URLs match in both your OAuth provider settings and your app configuration
- Make sure
NEXT_PUBLIC_SITE_URLis set to your production URL in production (or ensurebaseUrlinconfig/app.config.tsis correct) - Check the browser console and server logs for error messages