Cookies not setting in turborepo project
Issue: Cookies not setting in turborepo project
Hey folks, I'm running into an issue with setting cookies in a turborepo setup.
Project structure:
* Website A → built with TanStack Start
* API → built with Hono
* Shared auth package → located in
/packages/auth
, used by both projects. (look at the attached file)
In the Hono API:
I'm initializing auth like this:
CORS + route setup:
In the TanStack Start website:
I’m initializing the client like this:
Problem:
When calling authClient.signIn.email(...)
, the backend does respond with a Set-Cookie
header, but the cookie is not actually set in the browser.
As a result, the redirect works visually, but on /dashboard
, the user isn't authenticated because there's no session cookie.
Extra context:
I'm using this on the server side to check the session before each page load:
Things I've already set:
Anyone run into this in a monorepo/turborepo setup?
Would appreciate any tips 🙏0 Replies