Next.js Discord

Discord Forum

Login page SSR using local storage token?

Unanswered
Black carp posted this in #help-forum
Open in Discord
Black carpOP
I'm using local storage to store token, we are shifting CSR to SSR now using Nextjs auth, but I'm confused how to shift get token and generate a loginned SSR page using app directory, right now i'm able to generate pages which are public but for Loginned pages, how to get token and generate on SSR?
Thanks in advance

1 Reply

Magyar agár
If transition to use SSR and Nextauth I think you should use cookies to store your sessions instead of localstorage.
https://nextjs.org/docs/pages/building-your-application/authentication#session-management