Custom protected routes?
Hey guys I'm wondering about the best way to achieve something.
I added a custom property to my User table which is ROLE
Role can be USER, ADMIN, or SUPER_ADMIN
I want to gate a route /admin and all of its potential future subroutes behind a check to ensure someones role is ADMIN.
I was adding this to each page but this seems obtuse / incorrect.
Is there a better way to gate entire routes behind custom checks than what I am doing here?
I added a custom property to my User table which is ROLE
Role can be USER, ADMIN, or SUPER_ADMIN
I want to gate a route /admin and all of its potential future subroutes behind a check to ensure someones role is ADMIN.
I was adding this to each page but this seems obtuse / incorrect.
Is there a better way to gate entire routes behind custom checks than what I am doing here?