question abt how to stay logged in while moving across pages
Unanswered
Morelet’s Crocodile posted this in #help-forum
Morelet’s CrocodileOP
hi!! im a beginner but i kind of learnt how to make a login and create a session token with cookies and whatnot and have it connected to a database !!! but i wanted to ask if i wanted to have different pages for the screen but all of it is still connected to the account after login do i have to do those connect() things for every single page or something? or is it that Now you have the session token all the data related to the database is gonna follow you around everywhere?
16 Replies
if you are fetching the session inside page, then yea you have to do it on each
Morelet’s CrocodileOP
i see! thank youu
i also have to put in the Next Response stuff right?
Fan-tailed Warbler
Yes you have to do that also man
If you need a good idea and step by step you can reach out to me I'll help you
If you want
@Morelet’s Crocodile
@Fan-tailed Warbler If you need a good idea and step by step you can reach out to me I'll help you
Morelet’s CrocodileOP
thank yoU!! ill mesage you when i start working it
Morelet’s CrocodileOP
question . (slightly unrelated sorry) but How do you get that styles folder?
Morelet’s CrocodileOP
i saw this nice tutorial using Neon as a database and the tutorial i followed previously to make a login used mongo db, iwanted to switch everything connected to mongodb to neon but is clerk necessary ? it says something to do with auth but i just wanted to make this website to learn how to make a loginable mood tracker So i dont think i need some big security stuff. unless its something imporant to do with the session token or whatnot
Morelet’s CrocodileOP
for example its asking here
Cinnamon Teal
How do you get that styles folder?It's just a folder you can manually create.
but is clerk necessaryNo, Clerk is a 3rd party hosted auth provider. You don't need it to learn and practice things.
I suggest you read through this guide from the official Next.js docs: https://nextjs.org/docs/app/guides/authentication
It covers everything you need to have a basic auth setup.
Morelet’s CrocodileOP
thank you!