same route on role-based on nextjs

53 Views Asked by At

I am creating a app on nextjs . my folder structure is this . the problem i am facing and as i am new to this nextjs . there is button in header category. when logged in i will get role on my response. when logged in as user it should show (user)/category and when logged in as admin it should show (admin)/category . i need the route to look like /category . similar to other pages .

folder structure

i am expecting to get different pages of /category based on their role .

0

There are 0 best solutions below