When I use the ‘Try your Login box’ option everything works as expected. However, when I try and do it through my React application the action does not fire, it gets no logs and the roles claim is not on my token. Any help is appreciated.
Your code snippet is correct, I took it to my Auth0 tenant’s Actions and the access token issued has the "test-1865945745686/roles": [], claim within a payload.
In this case very likely is that your app is not fully configured with Auth0. Can you please check the doc you’ve used to set up your app with Auth0 to see if you are missing some something?
On your app code base side you need the Client ID (registered in Auth0) of your app, the Auth0 domain and the audience (API identifier) for which you want Auth0 to issue the access token: