Ready to post? First, try searching for your answer.
I have created action like this
exports.onExecutePostLogin = async (event, api) => {
if (event.authorization) {
const id = event.user.user_id;
api.accessToken.setCustomClaim(âtl_idâ, id);
}
};
But when I request accessToken like this I canât see tl_id in my accessToken
export const getAuth0ManagementApiToken = async () => {
const options = {
method: âPOSTâ,
url: ${process.env.AUTH0_ISSUER_BASE_URL}/oauth/token
,
headers: { âcontent-typeâ: âapplication/x-www-form-urlencodedâ },
data: new URLSearchParams({
grant_type: âclient_credentialsâ,
client_id: process.env.AUTH0_CLIENT_ID ?? ââ,
client_secret: process.env.AUTH0_CLIENT_SECRET ?? ââ,
audience: ${process.env.AUTH0_ISSUER_BASE_URL}/api/v2/
,
}),
};
const req = await axios.request(options);
return req.data;
};