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
barry14mo ago
Why resort to JWT in the first place Usually not the best or simplest solution
Alefe Bispo - BRT
Its the only auth method i know how to use. I'm using Nestjs for my back-end. Could you sugest another option?
Dylz
Dylz14mo ago
Db session
Alefe Bispo - BRT
Do you have some material so i could learn about?
Dylz
Dylz14mo 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
Matvey14mo ago
JWT can have many advantages if you implement them correctly just don't store them in LocalStorage
barry
barry14mo ago
It’s only really useful for stateless auth and few projects need that
Want results from more Discord servers?
Add your server