# Post user registration action doesn't send any data other than email

**URL:** <https://community.auth0.com/t/post-user-registration-action-doesnt-send-any-data-other-than-email/74582>\
**Category:** Get Help\
**Created:** [December 9, 2021, 5:07pm UTC](https://community.auth0.com/t/post-user-registration-action-doesnt-send-any-data-other-than-email/74582 "2021-12-09T17:07:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lutaev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lutaev/32/33644_2.png) [@lutaev](https://community.auth0.com/u/lutaev)\
**Post date:** [December 9, 2021, 5:07pm UTC](https://community.auth0.com/t/post-user-registration-action-doesnt-send-any-data-other-than-email/74582/1 "2021-12-09T17:07:23Z")

</div>

Hi there. Thank you for you impressive work.

I’m trying to migrate from hooks to actions and found that post registration action sends only email and nothing else. Here is the code of my action:

```auto
const axios = require("axios");

exports.onExecutePostUserRegistration = async (event) => {
  await axios.post(`${event.secrets.API_HOST}/register`, { 
    ...event.user
  });
};

```

and here is the data I get in my app:

```auto
{
  email: 'dergunov.web+3@gmail.com',
  username: undefined,
  id: undefined
}

```

I also tried to add something to axios request by myself, e.g.:

```auto
await axios.post(`${event.secrets.API_HOST}/register`, { 
  ...event.user,
  custom_id: 1
});

```

and I successfully got **custom\_id** in my app.  
What can cause it? I need at least email, username and id for successful registration on my side.

My tenant name is dev-p4e-5s5r  
My user has email [dergunov.web+3@gmail.com](mailto:dergunov.web+3@gmail.com)

Thanks.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [December 10, 2021, 8:10pm UTC](https://community.auth0.com/t/post-user-registration-action-doesnt-send-any-data-other-than-email/74582/3 "2021-12-10T20:10:51Z")

</div>

Hi @lutaev,

Welcome to the Auth0 Community!

I understand you have issues sending the _email_, _username_, and _user\_id_ attributes with your Post-User Registration Action script.

First, I have gone ahead and tested the Action and did not find the same observations. When I check the _event.user_ object, I can see the user profile attributes listed [here](https://auth0.com/docs/actions/triggers/post-user-registration/event-object).

Given that, have you made sure that your Database Connection has the _Requires Username_ toggle enabled?

And, could you please try using the [Real-time Webtask Logs Extension](https://auth0.com/docs/extensions/real-time-webtask-logs) to see the complete _event.user_ object during the signup flow?

Lastly, I double-checked your Action saved on your tenant, and there seem to have three dots prepended to the event.user which is syntactically incorrect. You’ll want to do something like the following:

```auto
  await axios.post(`${event.secrets.API_HOST}/register`, { 
    event.user,
    id: 1
  });

```

Looking forward to your reply.

Thank you.

---

<div class="post-metadata">

**Author:** ![lutaev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lutaev/32/33644_2.png) [@lutaev](https://community.auth0.com/u/lutaev)\
**Post date:** [December 13, 2021, 7:55am UTC](https://community.auth0.com/t/post-user-registration-action-doesnt-send-any-data-other-than-email/74582/4 "2021-12-13T07:55:54Z")

</div>

Thank you for your answer, it is really helpful. Looks like spread operator and destructuring are not supported by auth0, that was the reason.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [December 13, 2021, 3:40pm UTC](https://community.auth0.com/t/post-user-registration-action-doesnt-send-any-data-other-than-email/74582/5 "2021-12-13T15:40:18Z")

</div>

Hi @lutaev,

Thank you for your response and for providing the extra context.

I’m glad that everything is working now!

Please don’t hesitate to reach out if you have any further questions.

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 28, 2021, 3:40pm UTC](https://community.auth0.com/t/post-user-registration-action-doesnt-send-any-data-other-than-email/74582/6 "2021-12-28T15:40:53Z")

</div>

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