Next.js Discord

Discord Forum

How to keep user info (name, email etc.) on the server side in the context of a backend API?

Unanswered
Atlantic cod posted this in #help-forum
Open in Discord
Atlantic codOP
I use NextJS to fetch data from another headless server using JWT and display different pages in a SEO friendly way which would otherwise not be possible using a client side SPA.
I wonder what is the best way to keep the authenticated user (username and isAuthenticated status mainly) stored somehow and accessible between different pages? JWT is stored as httpOnly of course, should I just put all of this in a httpOnly cookie?

I’m interested to hear what are the best practise with regards to such a use case.

Thank you!

0 Replies