Relative Content

Tag Archive for reactjstypescriptjwtdjango-rest-framework-simplejwtnextjs14

How to Store JWT Token for SSR in Next.js 14 Without Using localStorage?

I am facing an issue with storing a JWT token in Next.js 14. I want to load a page using SSR, but localStorage is not supported in server-side components. My scenario is as follows: after logging in, the backend responds with a JWT token, which I currently store in localStorage. However, localStorage is not accessible in server-side components. How can I properly store the JWT token in this case.