Vercel.app for previews
Hi,
I'm using BetterAuth in production across two different subdomains:
api.example.com
(where BetterAuth is hosted) and site.example.com
(I've configured cookiesubdomain
, etc.). Everything works perfectly in production, and I'm hosting with Vercel.
However, when I create new branches or run tests, Vercel assigns preview domains under .vercel.app
, and at that point authentication stops working.
Is there a way to make authentication work correctly on these Vercel preview domains as well? Do you have any suggestions or best practices for handling this?
Thanks in advance!3 Replies
you can use VERCEL_URL which is default env setting on vercel for baseUrl
?? What about the cookie configuration? There is no issue with the baseUrl, the issue is with the cookie
give me your auth config
you mean this one -