How retrive user's role in NodeJS/ExpressJS using the Auth0's Core Authorization Feature Set

I would like to integrate roles in my NodeJS/ExpressJS REST API app.
I currently use a rule to automatically retrieve from user login the email associated with the authentication method (I have enabled: Facebook, Twitter and Google Social connections).
I know that I can use

express-jwt-authz

to handle scopes as in this example code.

But in this way, I can enable or disable altogether a REST endpoint based on user scope.
How can I instead:

  1. enable or disable the endpoint using user Role (not scope)
  2. retrieve user role name and redirect to different routes

Thanks in advance.

Hey @ferlito.sergio,

You can control the scopes based on user roles, something like this explained below:

Does this help?

Regards,
Sidharth