Cross Domain : Receiving null for both data and error while fetching session
I have a nextjs frontend and a hono backend both hosted in ec2 instance through docker. While logging in the cookies are being passed and stored in the browser, but after loging in the user is redirected to dashboard page where i use
To check active session , i am getting null for both data and error and is redirected back to login.
Note : this setup works fine locally. Also it works fine when the login route is called to the localserver and all other to the hosted server.
I have enabled the cookies to be samesite none , partitioned, httpOnly everything
5 Replies
Is there any additional thing i am forgetting in nextjs to get the headers in production ?
can you send auth config
This is the auth.ts file from hono
I suspect that in production nextjs is not sending cookies
try disabling the crosssubdomain cookies as this could be a blocker
double check if the cookies have the samesite set to none and secure to true (the cookie passed in production)