# Post user registration action does not trigger

**URL:** <https://community.auth0.com/t/post-user-registration-action-does-not-trigger/99429>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [February 1, 2023, 12:28am UTC](https://community.auth0.com/t/post-user-registration-action-does-not-trigger/99429 "2023-02-01T00:28:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ali4](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ali4/32/44206_2.png) [@ali4](https://community.auth0.com/u/ali4)\
**Post date:** [February 1, 2023, 12:28am UTC](https://community.auth0.com/t/post-user-registration-action-does-not-trigger/99429/1 "2023-02-01T00:28:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 1, 2023, 2:00am UTC](https://community.auth0.com/t/post-user-registration-action-does-not-trigger/99429/3 "2023-02-01T02:00:40Z")

</div>

Hello @ali4 welcome to the community!

> [@ali4](#):
>
> 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.

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](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/event-object).

Keep us posted!

---

<div class="post-metadata">

**Author:** ![ali4](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ali4/32/44206_2.png) [@ali4](https://community.auth0.com/u/ali4)\
**Post date:** [February 1, 2023, 6:07pm UTC](https://community.auth0.com/t/post-user-registration-action-does-not-trigger/99429/4 "2023-02-01T18:07:23Z")

</div>

Hello @ty.frith, 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.

---

<div class="post-metadata">

**Author:** ![ali4](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ali4/32/44206_2.png) [@ali4](https://community.auth0.com/u/ali4)\
**Post date:** [February 2, 2023, 8:18pm UTC](https://community.auth0.com/t/post-user-registration-action-does-not-trigger/99429/5 "2023-02-02T20:18:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 3, 2023, 12:12am UTC](https://community.auth0.com/t/post-user-registration-action-does-not-trigger/99429/6 "2023-02-03T00:12:59Z")

</div>

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:

```auto
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:

[https://community.auth0.com/t/how-can-i-use-the-management-api-in-actions/64947](https://community.auth0.com/t/how-can-i-use-the-management-api-in-actions/64947)

Let us know!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 18, 2023, 12:13am UTC](https://community.auth0.com/t/post-user-registration-action-does-not-trigger/99429/7 "2023-02-18T00:13:00Z")

</div>

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