sparse-spring-91820
01/13/2023, 9:10 AM400 Bad Request: trigger is not supported
for post-user-registration
trigger:
Code sample:
const createIdentityAction = new auth0.Action('create-identity', {
name: 'Create Identity',
runtime: 'node16',
code: fs.readFileSync(
path.join(__dirname, './create-identity.js'),
'utf-8'
),
deploy: true,
secrets,
supportedTriggers: { id: 'post-user-registration', version: 'v3' },
dependencies: [{ name: 'axios', version: '1.2.2' }]
});
And here is create-identity.js
file:
const axios = require('axios');
exports.onExecutePostUserRegistration = async (event, api) => {
const { user_id: ssoId, email } = event.user;
const {
domain,
clientId,
clientSecret,
audience,
serverHost
} = event.secrets;
const options = {
method: 'POST',
url: `https://${domain}/oauth/token`,
headers: { 'content-type': 'application/json' },
data: {
client_id: clientId,
client_secret: clientSecret,
audience,
grant_type: 'client_credentials'
}
};
const { access_token } = await axios(options).then(res => res.data);
const headers = { Authorization: ['Bearer', access_token].join(' ') };
const createIdentityRoute = `https://${serverHost}/api/identity`;
// TODO: Implement retry strategy
await <http://axios.post|axios.post>(createIdentityRoute, { ssoId, email }, { headers });
};
Does anyone know why I get trigger is not supported
error if I basically copied trigger name from their website: https://auth0.com/docs/customize/actions/flows-and-triggers?
I am using "@pulumi/auth0": "^2.14.0"
v3
to v2
. Just one suggestion: it would be great if you improve auth0 actions documentation and type safety by creating Trigger type that would allow only correct values. Keep doing great work Pulumi team! 🚀many-telephone-49025
01/13/2023, 12:34 PM