Authorize User or Session in Separate Hono Server but Better-Auth is in Nextjs
I have a nextjs app setup with better-auth. I have a separate server, but I need to authorize and get the user in my hono server. How would I do it? As http cookies are not sent over other domains. Please help.
3 Replies
+1
this means you want different parts of an application run on different domains or server but need to share authentication state ?
Got the answer in the docs
https://www.better-auth.com/docs/concepts/cookies#cross-subdomain-cookies
you can allow cookies to passed to trusted subdomains
Cookies | Better Auth
Learn how cookies are used in Better Auth.