Post user registration action does not trigger

I defined a post user registration action. I invite a non-existing user to an Organization in Auth0 using DB connection and using management API, after the user receives the email, clicks on the invite, and enters the password his account is created but the action is never triggered.

I have another Login action that is triggered and I see it in the logs. I checked the previous posts about the same topics and seems like a while back there was an issue with logging the action in the logs. Is this the same issue I’m encountering? The action is supposed to send a message to my API but that never happens.

Thanks,
Ali

Hello @ali4 welcome to the community!

This still looks to be in our backlog unfortunately (logging), however the Action should execute - Is your API just not hit at all? It’s worth mentioning that event.organization is not available in a Post User Registration Action like it is in a Post Login Action.

Keep us posted!

Hello @tyf, the action is trying to send a message to a RabbitMQ service but the message is not sent. I tried to troubleshoot with adding console.log and test the action directly with some test data, but Test Results Panel doesn’t show any errors and it neither shows the console log message. So I don’t know how else to troubleshoot the issue.

Any update about this issue? Is there anything I can do to troubleshoot further?

Hey @ali4, thanks for the additional info, and sorry for inconvenience - Perhaps you can try the code from a post login action? I tested on my end by adding code to hit the management API to add a role to a newly registered user:

exports.onExecutePostUserRegistration = async (event) => {

  const ManagementClient = require('auth0').ManagementClient;

  //initialize management client
    const management = new ManagementClient({
      domain: event.secrets.domain,
      clientId: event.secrets.clientID,
      clientSecret: event.secrets.clientSecret,
  });

  const params =  { id : event.user.user_id};
  const data = { "roles" : ["rol_id"]};

  try {
    const res = await management.assignRolestoUser(params, data)
  } catch (e) {
    console.log(e)
    // Handle error
    console.log("there was an error :(")
  }
};

If you want to try this, you can find some more on using the node management client in an action here:

Let us know!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.