Next.js middleware not able to read better auth session token

I have the my Nest.js backend running on digital ocean vps with custom domain. The frontend is built with next.js, when I try to login in the application, I cookies are getting set as you see in the image, but the next.js middleware is not able to read/get the session cookies. This is working super good when we are running the backend on localhost, but on deployment this is happening. I have updated cookie settings with secure = true, samesite = none, httpOnly = false, partition = true. What am I missing?
No description
3 Replies
Bhavik | Building MVPs at Zexa
Hey do I need to keep both frontend and backend on the same domain to allow this.
braga
braga2mo ago
Bhavik | Building MVPs at Zexa
Thanks man !! I ended using same domain for both frontend and backend and it was working but atleast now I now how to work with different domains !!

Did you find this page helpful?