Please include the following information in your post:
Which SDK this is regarding: nextjs-auth0
SDK Version: 1.1.0
Platform Version: Node v14.15.4
This auth0 document explains what I am trying to achieve but I will elaborate below:
What I am trying to achieve:
- There are two types of “roles” I would like to define for my nextjs application, let’s call them
Adminshave there own page, let’s call it
Visitorsshould not be able to access the route
(This is basically what is described above in the Auth0 doc)
My overarching question is: How do I accomplish the above with the nextjs SDK?
Where my confusion lies:
- Nextjs SDK suggests creating a Regular Web Application in the Auth0 dashboard which I have done but RBAC is a feature of API’s.
- Let’s say I create an API along side my Regular Web Application and assign my users with the roles and permissions from the new API, how to I have access to these “roles” or “permissions” in my nextjs app?
- I would assume that restricting a
/adminroute would happen in the
getServerSidePropsbut, again, how is this accomplished?