Vercel Preview runtime logs or browser
BetterAuthError: Invalid origin: https://…-git-….vercel.app is not a trusted origin
- What it means
- You tried to sign in on a Vercel Preview link, and Better Auth blocked the request because it hasn't been told to trust your project's Preview URLs yet.
- Likely causes
trustedOriginsin your Better Auth configuration only listslocalhost:3000and the production domain.BETTER_AUTH_URLis hardcoded to Production even when running on a Preview deployment.
- Prevention
- Always test sign-up and sign-in on a Preview link before merging your auth branch.
Copy for your agent
Signing in on my Preview link fails with `Invalid origin: not a trusted origin`. Use the `better-auth-security-best-practices` skill to configure `trustedOrigins` safely for our Vercel Preview URLs.
Was this page helpful?