Observable/watcher inside of nextjs 14 layout?
Unanswered
Oriental Scops-Owl posted this in #help-forum
Oriental Scops-OwlOP
is it somehow possible to have a way to watch if a cookie is set/changed inside a layout.ts file?
you can see in my screenshot the type of approach i need to take...
right now i just have isAuthenticated to false. Im not sure how i would do this within a layout file since its server-side rendered?
you can see in my screenshot the type of approach i need to take...
right now i just have isAuthenticated to false. Im not sure how i would do this within a layout file since its server-side rendered?
5 Replies
Oriental Scops-OwlOP
i need it so that whenever the cookie is changed on server-side the UI will rehydrate as well
Oriental Scops-OwlOP
anyone?
Oriental Scops-OwlOP
i figured it out.. had to create an API route to fetch() and then have that check if a cookie exists. then stuffed that into an authprovider
kind of works.. still playing with it
k got it 🙂