Hi everyone, I’m new to Auth0.
I want to access user’s role from a React SPA, simply to display it beside it’s name.
I’m currently using the example React SPA available here auth0-react-samples/Sample-01 at master · auth0-samples/auth0-react-samples · GitHub
I added the below action as PostLogin Action
exports.onExecutePostLogin = async (event, api) => {
// This action adds the authenticated user's email address to the access token.
var roles = event.authorization?.roles || ['TEST'];
if (roles) {
api.user.setAppMetadata("roles", roles);
}
};
However, I don’t know how to access AppMetaData either…
Could you help me ?