Relative Content

Tag Archive for reactjsnext.jsserver-side-rendering

How to use cookie authentication using “use server”

I’m working with Next.js and using JWT tokens for authentication. After logging in, I set the token in cookies. It works perfectly on localhost, but after deployment on the server, it’s not functioning as expected. It works fine on the domain when using “use client,” but not with “use server.”