The Nextjs SDK documentation should have more documentation on how to implement custom domains for auth. I've asked here for support on it and have yet to find a solution, but even when I do, the docs should be a bit more helpful here.
Hey @Jeremy, Sorry that you have been experiencing issues with implementing custom domains for auth with your NextJS app. I have passed on your feedback on documentation to my team mate who handles our docs.
Thank you, I think I finally got it working as well as I can. I did the cookie thing, but importantly only had to set that on my vercel dev env (not preview envs, prod, or local). Also I was getting mixed up with VERCEL_URL and VERCEL_BRANCH_URL. Following the custom domain and preview docs, that implements VERCEL_URL, which is not what the Vercel Github bot uses. I added a comment here: https://github.com/kinde-oss/kinde-auth-nextjs/issues/86#issuecomment-2064915911
I think I'm good now I'm just trying to elaborate in case you want to add to the docs the difference between VERCEL_URL and VERCEL_BRANCH_URL. And that you can not get both to work, because the env vars are set at build time so you can't dynamically figure out which host the user is using.