I’m trying to set up a Preview deployment with Vercel. I have set my Preview specific env variables for Auth0 and I have set a specific preview URL as well. Now, all of my preview deployments go to https://preview.myapp.com. The problem is, when I click “Login”, the redirect-url is: https://{app-name}-hktimzl6y-{project-name}.vercel.app/api/auth/callback - so it’s failing to login
Hello, welcome to the Auth0 Community. Thanks for building with Auth0 on Vercel. I’ll be happy to provide guidance on how to make authentication work on Vercel previews
Let me ask you, please, a couple of questions to understand better your project configuration:
- Are you using the Vercel GitHub app to deploy your projects both for production and preview environments or what’s you deployment approach?
- How are you mapping all the Vercel preview URLs to that fixed custom domain? What happens with prior deployment URLs? Is that fixed domain always mapping to the most recent preview deployment?