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
disguise_duck
disguise_duck5mo ago
+1
KiNFiSH
KiNFiSH5mo ago
this means you want different parts of an application run on different domains or server but need to share authentication state ?
Rishil Shah
Rishil ShahOP5mo ago
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.

Did you find this page helpful?