-
Hi! This is an interesting starter kit! I think I have some few questions. How would I do role-based auth in here? My current way is this:
I do this for every page.tsx of the route. Now, when compiling, I notice that even my login page is a server function. I have no interactivity in there. It's just a login page. How do you guys solve this? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, glad to hear that you liked this kit! Actually the issue you're facing is the expected behavior as
For more information, please read: https://nextjs.org/docs/app/building-your-application/rendering/server-components#dynamic-functions |
Beta Was this translation helpful? Give feedback.
-
Yeah, that makes a lot of sense. Thanks! |
Beta Was this translation helpful? Give feedback.
Hi, glad to hear that you liked this kit!
Actually the issue you're facing is the expected behavior as
validateRequest
function pulls user session information fromcookies
that makes the whole route dynamic. Also, it is ideal to keep these routes dynamic. otherwise same content will be shown to all visitors whether the have access or not.For more information, please read: https://nextjs.org/docs/app/building-your-application/rendering/server-components#dynamic-functions