When i’m trying to get user roles in access token it does not work for me
what i’m doing wrong can anyone help me to figure out1
This is my action code
exports.onExecutePostLogin = async (event, api) => {
const ManagementClient = require("auth0").ManagementClient;
const management = new ManagementClient({
domain: event.secrets.domain,
clientId: event.secrets.clientId,
clientSecret: event.secrets.clientSecret,
});
const userRoles = await management.users.roles(event.user.user_id);
api.accessToken.setCustomClaim("roles", userRoles);
};
error i’m getting
management.users.roles is not a function