# `BetterAuthError: Invalid origin: https://…-git-….vercel.app is not a trusted origin`

**Where it appears:** Vercel Preview runtime logs or browser

**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

- `trustedOrigins` in your Better Auth configuration only lists `localhost:3000` and the production domain.
- `BETTER_AUTH_URL` is hardcoded to Production even when running on a Preview deployment.

## Message for your agent

```text
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.
```

**Prevention:** Always test sign-up and sign-in on a Preview link before merging your auth branch.

---
Source: [Agentic Makers](https://agenticmakers.app/en/help/errors/better-auth-invalid-origin-not-trusted) · License: CC BY 4.0
