Skip to content

Lucia Auth role-based auth #70

Closed Answered by iamtouha
kernpinoy asked this question in Q&A
Discussion options

You must be logged in to vote

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 from cookies 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.

cookies() and headers(): Using these in a Server Component will opt the whole route into dynamic rendering at request time.

For more information, please read: https://nextjs.org/docs/app/building-your-application/rendering/server-components#dynamic-functions

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by kernpinoy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants