What is the best strategy to deal with JWT in Nextjs?

With React, I retrieve user and token information with context or local storage anywhere in the app. How to get context data in a server component?
8 Replies
barry
barry17mo ago
Why resort to JWT in the first place Usually not the best or simplest solution
Alefe Bispo - BRT
Alefe Bispo - BRTOP17mo ago
Its the only auth method i know how to use. I'm using Nestjs for my back-end. Could you sugest another option?
Dylz
Dylz17mo ago
Db session
Alefe Bispo - BRT
Alefe Bispo - BRTOP17mo ago
Do you have some material so i could learn about?
Dylz
Dylz17mo ago
If you’re using next auth there is tons of documentation on it. If you’re attempting to build your own auth… just remember there’s a reason it’s not something people do all the time
Matvey
Matvey17mo ago
JWT can have many advantages if you implement them correctly just don't store them in LocalStorage
barry
barry17mo ago
It’s only really useful for stateless auth and few projects need that
Want results from more Discord servers?
Add your server