How does one go about accessing the list of permissions returned with the access token?
I am using the react-auth0-spa module (containing the Auth0Provider functional component) in combination with the PrivateRoute component (see https://github.com/auth0-samples/auth0-react-samples/blob/master/01-Login/src/components/PrivateRoute.js) and it isn’t clear how to de-reference the permissions array.
I have a route for example the Settings page that should only be accessed by Super Admins that have the required permissions (for example read:settings). So it is a route that not only requires an authenticated user but also one that has the appropriate permission.
I am thinking I need to augment the PrivateRoute component to have an additional permissions check for the Settings page and redirect to a Not Authorized page if the user doesn’t have the required permissions. I have confirmed that the permissions array is being returned but it isn’t clear to me how I would access this array.
Any pointers appreciated.