#Initial state loading
33 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
you can do that in server components, try to see the documentation on what you can do in server components
especially the data fetching article
https://nextjs.org/docs/app/building-your-application/data-fetching/patterns
I've seen it but I still don't understand how to send request for checking current user beacuse it requires jwt
where is currently the problem? To get the jwt? To auth the user? To create the login form? ...
I get my user information by sending request that includes jwt. As I know I can't access jwt in server components
So I can't fetch current user in server componenet
Which library do you use to auth the user?
I have my own backend
So I do auth with http requests to it
ah ok. Set the important keys as cookie and then access the cookies on your server component and fetch the user serverside
but jwt are usually stored in localstorage
and?
I want to do so
yea, you can do so
so what's the common way to do that with jwt in localstorage
exactly like I told you
Set the important keys as cookie and then access the cookies on your server component and fetch the user serverside
ok, thanks
But also I wanna know what's the best way to implement it without server components
without? 🤔
In nextjs? If you want to do everything without, that you should use react ^^
the "db" part is where you auth your user and get your user data
to get the user or to auth your user?
ok, thanks
Please mark a message as solution to your problem. You can see how to do that here: #1163105513492467843 message