API calls returns Unauthorized
I have better auth setup on
https://accounts.domain.com
in production, for testing purposes
When I hit /api/auth/get-session
on another app, running in localhost
, I get 401 unauthorized.
I also have the multi domain setup like this
My BetterAuth ENV
Any idea why I get 401 though am logged in on the accounts.domain.com?4 Replies
how are you passing the session token?
This is the localhost middlware.ts
if you're logged in at account.domain.com the cookie isn't stored on localhost and if it's stored it's only sent to account.domain.com
Okay makes sense...
During development, I will get the accounts.domain.com running locally as well
Thanks.
If I can set sameSite to "None" on the cookie, I can share it with localhost, right?
I saw solutions on how to share cookie across multiple domains, but I can't set sameSite to None on better-auth to achieve that