# Post User Registration user does not have user.name property

**URL:** <https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340>\
**Category:** Get Help\
**Tags:** actions-management-api, management-api\
**Created:** [May 19, 2023, 1:29am UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340 "2023-05-19T01:29:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilesf](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@gilesf](https://community.auth0.com/u/gilesf)\
**Post date:** [May 19, 2023, 1:29am UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/1 "2023-05-19T01:29:54Z")

</div>

Hello,

I’ve written a Post-User Registration Action to create a user in a 3rd party application (Hubspot) once the user has been created in the Auth0 database. I need to port over the `email` and `name` fields to this application every time a new user has signed up.

My action successfully gets called when my application does a post to create the user in auth0 however, when I log the incoming data on the event.user, I see something like this in the Action Logs despite providing the `name` field:

```auto
{
  email: 'email@emailProvider.com',
  tenant: 'someTenant',
  user_id: 'auth0|fooBar',
  app_metadata: {
    companyId: 'someCompany',
    customMetaField: {
      flagOne: false,
      flagTwo: false,
    }
  },
  user_metadata: {},
  created_at: undefined,
  updated_at: undefined,
  email_verified: true,
  phone_verified: false
}

```

There is no name field, and other fields like the created\_at and updated\_at are undefined.  
However when I look at the user details in auth0, it has the name. The raw JSON shows all the fields including the `created_at` and `updated_at` fields.

When I use the action tester, that request has all the user information specified and my action works perfectly if I receive all the provided data, but somehow I’m not getting all that information in reality.

Does anyone have an idea why this data isn’t coming through? I appreciate any help on this issue.

Thank you,

Giles

---

<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:** [May 19, 2023, 6:42pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/3 "2023-05-19T18:42:09Z")

</div>

Hi @gilesf,

Welcome to the Auth0 Community!

The correct property to call for the user’s name in a Post User Registration Action is the `event.user.name` property,

See the [Actions Triggers: post-user-registration - Event Object](https://auth0.com/docs/customize/actions/flows-and-triggers/post-user-registration-flow/event-object) documentation for the full list of callable properties.

Please let me know if you have any questions.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![gilesf](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@gilesf](https://community.auth0.com/u/gilesf)\
**Post date:** [May 19, 2023, 8:52pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/4 "2023-05-19T20:52:12Z")

</div>

Thanks for your response @rueben.tiow

I’m not sure I understand your answer based on the documentation you’ve linked to. According to the event object documentation, the `user` is a property under the `event` and it has the `name` directly on it.

I’m currently doing something like this in my action:

```auto
exports.onExecutePostUserRegistration = async (event, api) => {
  const request = require('request');

  console.log(event.user)
  console.log(`name`, event.user.name)

  const firstName = event.user.name ? event.user.name.split(' ')[0] : ''
  const lastName = event.user.name ? event.user.name.split(' ')[1] : ''

```

My printouts show me that the user exists but it just doesn’t have the name. Where does the user come from in your example? Would you be able to show me an example?

Thanks for your help,  
Giles

---

<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:** [May 22, 2023, 4:06pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/5 "2023-05-22T16:06:35Z")

</div>

Hi @gilesf,

Thank you for your response.

> [@gilesf](#):
>
> My printouts show me that the user exists but it just doesn’t have the name. Where does the user come from in your example? Would you be able to show me an example?

I appreciate you sharing your Action script with me. After testing it on my side, I could not reproduce the issue you encountered. The code snippet you provided worked perfectly and successfully set the user’s `firstName` and `lastName` variables.

To support my statement, I have included a screenshot below displaying the results of my tests:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/0/c/0c858a49d504fff62e7601010b59dcfb17f5875c.png)

In this case, I would like to kindly suggest using the [Real-time Webtask Logs Extension](https://auth0.com/docs/customize/extensions/real-time-webtask-logs), which allows you to monitor the `console.log()` statements in real-time when a user signs up.

I suspect the issue you are facing might be due to the absence of a `name` attribute for the created user.

To assist you further, could you please provide clarity on how this user is being created?

Are they signing up through your app’s login page, or are you creating them on their behalf using the [Management API’s Create a user endpoint](https://auth0.com/docs/api/management/v2#!/Users/post_users)?

I look forward to your update.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![gilesf](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@gilesf](https://community.auth0.com/u/gilesf)\
**Post date:** [May 23, 2023, 9:53pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/6 "2023-05-23T21:53:43Z")

</div>

Hi @rueben.tiow,

Thanks for your response. I actually also ran the same test using the action tester and came to the same conclusion that nothing was wrong with the action itself. The problem is indeed that I’m not getting the name on the incoming `event.user` object and so, I believe the problem is upstream from the action.

To answer your question, we use the management client to create the user and then request a password change. The code looks something like this (modified slightly to omit sensitive information):

```auto
public createUser = ({ userId, email, fullName, appMetadata}): Promise<void> => {
    await this.managementClient.createUser({
      email,
      name: fullName, // <---
      user_id: userId,
      password: 'password',
      connection: 'Username-Password-Authentication',
      verify_email: false,
      email_verified: true,
      app_metadata: appMetadata
    });

    await this.authenticationClient.requestChangePasswordEmail({
      email,
      connection: 'Username-Password-Authentication'
    });
}

```

As you can see, we do populate the name field when the user is created. I know that it works given that the name is present when I view the user in auth0 (`User Management > Users`) and it is present in the raw JSON details. The app\_metadata fields are also what I expect them to be in the created user details.

The `Action > Action Logs` feature that you have in beta shows me my logs as I execute the above code. I’m able to run that snippet manually, and I see that I do not have the name field or the metadata as I explained in my previous post. I therefore believe that either the action isn’t getting all the info being sent to the management API or that something in-between that I’m unaware of may be removing this or prevent this info from getting to the action.

Does the `Real-time Webtask Logs Extension` work differently or provide me with some other benefit? As far as I can tell, I get the same result but maybe I’m not using it properly.

Best regards,  
Giles

---

<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:** [June 1, 2023, 1:55am UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/7 "2023-06-01T01:55:12Z")

</div>

Hi @gilesf,

Thank you for your detailed reply.

> [@gilesf](#):
>
> Does the `Real-time Webtask Logs Extension` work differently or provide me with some other benefit? As far as I can tell, I get the same result but maybe I’m not using it properly.

The Realtime Webtask Logs Extension works similarly to the Action’s Debugger interface, but in this case, it will show all the logs pertaining to the login transaction.

Now, looking at your code snippet carefully, it looks like you are passing the `userID`, `email`, `fullName`, and `appMetadata` to your createUser function to set those values appropriately to the user’s profile.

Could you please confirm the behavior you observe when passing hardcoded values?

Doing so will help us narrow down whether the values passed in the function are the correct and expected values.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![gilesf](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@gilesf](https://community.auth0.com/u/gilesf)\
**Post date:** [June 13, 2023, 10:16pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/8 "2023-06-13T22:16:16Z")

</div>

Hi @rueben.tiow,

I made a POST to `/api/v2/users` from the auth0 documentation page with the following hard coded request body:

```auto
{
  "email": "john.doe@gmail.com",
  "email_verified": true,
  "app_metadata": {
   "foo": "bar"
  },
  "name": "John Doe",
  "user_id": "abc",
  "connection": "Username-Password-Authentication",
  "password": "secret123$5",
  "verify_email": false
}

```

and I received a 201 response:

```auto
{
  "created_at": "2023-06-13T22:07:38.834Z",
  "email": "john.doe@gmail.com",
  "email_verified": true,
  "identities": [
    {
      "user_id": "abc",
      "connection": "Username-Password-Authentication",
      "provider": "auth0",
      "isSocial": false
    }
  ],
  "name": "John Doe",
  "nickname": "john.doe",
  "updated_at": "2023-06-13T22:07:38.835Z",
  "user_id": "auth0|abc",
  "app_metadata": {
    "foo": "bar"
  }
}

```

The action logs show me this:

```auto
{
  email: 'john.doe@gmail.com',
  tenant: 'XYZ',
  user_id: 'auth0|abc',
  app_metadata: { foo: 'bar' },
  user_metadata: {},
  created_at: undefined,
  updated_at: undefined,
  email_verified: true,
  phone_verified: false
}

```

The Real-time Webtask logs did not show me any logs. I occasionally get a " finished webtask request" which seems unrelated. Perhaps I’m doing something wrong here? The documentation for the real-time webtask log references rules but not actions:

> **[Real-time Webtask Logs Extension](https://auth0.com/docs/customize/extensions/real-time-webtask-logs)**
>
> Learn how to configure and use the Auth0 Real-time Webtask Logs extension.

Any thoughts on this? I tried to remove my code/application from my test, and so this is just a direct post right to auth0. I seem to be getting the same result - which is perplexing.

Thanks you your help,

Giles

---

<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:** [June 15, 2023, 6:56pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/9 "2023-06-15T18:56:06Z")

</div>

Hi @gilesf,

Thank you for your reply.

> [@gilesf](#):
>
> The Real-time Webtask logs did not show me any logs

In your `201` response, I noticed that you successfully created the user with the `name` property.

With the Action script, you should see the name John Doe produced in the logs.

If this was not the case, could you please confirm if you creating the user with the Realtime Webtask logs extension already opened?

Alternatively, using the Test feature in the Auth0 Debugger shows that the Action script works correctly.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/3/0/30f402f72076dc3d1febb136f3353ef2faea5d83.png)

Could you please confirm if you see the same behavior?

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![gilesf](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@gilesf](https://community.auth0.com/u/gilesf)\
**Post date:** [June 15, 2023, 8:18pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/10 "2023-06-15T20:18:54Z")

</div>

Hi @rueben.tiow,

Yes, the user definitely has the `name` property in auth0 when created this way.

> If this was not the case, could you please confirm if you creating the user with the Realtime Webtask logs extension already opened?

Yes, I open the Real-time Webtask Logs first and then run the request. In the following image, you can see I opened the logger at 12:39pm and I ran the request at 12:48pm:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/7/3/73d9a9970b4951b3c0cb0b289bcb6d957deb4a5e.png)

When I do the same thing with the Actions Logs, I see this:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/e/8/e87a9fd57a63363d281598614b03c2531906e8d5.png)

> Alternatively, using the Test feature in the Auth0 Debugger shows that the Action script works correctly.

I tested my Action using the action tester before opening up this issue and it was working there. From my original post:

> When I use the action tester, that request has all the user information specified and my action works perfectly if I receive all the provided data, but somehow I’m not getting all that information in reality.

This is what is confusing me. It seems like the management API and action are working independently, but when used together, it doesn’t work. I’ve deduced that some processing must be happening in-between the two that makes it so that not all the data gets to the action. I have no clue where that may be happening because I don’t have any other hooks set up. I do have a rule that adds some information to the token, but that shouldn’t affect this either.

Giles

---

<div class="post-metadata">

**Author:** ![patrick14](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@patrick14](https://community.auth0.com/u/patrick14)\
**Post date:** [August 23, 2023, 8:03pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/11 "2023-08-23T20:03:02Z")

</div>

Hi, just jumping in here to say that I’m experiencing the exact same issue as @gilesf and wondering if there is a solution other than building the full name from concating family and given names.

---

<div class="post-metadata">

**Author:** ![gilesf](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@gilesf](https://community.auth0.com/u/gilesf)\
**Post date:** [August 24, 2023, 4:44pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/12 "2023-08-24T16:44:15Z")

</div>

Hi @patrick14,

I was never able to resolve this issue. Are you saying that you can see the `given_name` and `family_name` properties on the `event.user` object? In my case, none of the properties aside from the email are what they are shown to be in the auth0 interface. I still do not know why those properties on not present in the post-registration hook.

---

<div class="post-metadata">

**Author:** ![patrick14](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@patrick14](https://community.auth0.com/u/patrick14)\
**Post date:** [August 24, 2023, 7:29pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/13 "2023-08-24T19:29:37Z")

</div>

My use case: when a user is registered in Auth0, depending on a field in their `app_metadata`, I make an API call to Databricks to provision a user. The created used in Databricks kept getting their email as their name. This is how I encountered the issue.

Despite having

```json
name: Foo Bar

```

in their `user_metadata` after user creation, the `event` in the hook never had the value. It _did_ have `familyName` and `givenName` so I just used that.

To solve, I post to Databricks using

```json
    "name" : {
      "familyName": familyName,
      "givenName": givenName
    }

```

but I couldn’t figure out why `name` wasn’t in the `event` object.

---

<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:** [August 25, 2023, 1:05am UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/14 "2023-08-25T01:05:56Z")

</div>

Hi [@gilesf](https://chat.openai.com/mention),

It’s quite interesting that the `name` property seems to be missing.

In my tests, I was able to create a new Action script, include the `console.log(event.user)`, and print the results:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/4/3/43a100536147f34763f8291c64610efb89d680f7.png)

From my results, I managed to match the `name` property that was passed with the `name` in the results.

Based on your screenshot, it appears that the `event.user` object didn’t receive any values for the `name`. I conducted an additional test by not providing a value for the name property, and I can confirm that this produces the same result you observed. Specifically, the `name` property holds no value:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/8/0/80c6677e9ed7b7e52a7d1c306707308c8f546823.png)

Would you be able to try creating a new script and just printing the `event.user` object?

Let me also mention that the Management API and Actions test debugger interface are independent of each other.

If you need to debug further, I recommend using the [Real-time Webtask Logs Extension](https://auth0.com/docs/customize/extensions/real-time-webtask-logs).

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![patrick14](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@patrick14](https://community.auth0.com/u/patrick14)\
**Post date:** [August 25, 2023, 4:22pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/15 "2023-08-25T16:22:21Z")

</div>

Here is the behavior that I am seeing. I create a user with the following request:

```json
  "request": {
    "url": "https://omitted.us.auth0.com/api/v2/users",
    "method": "POST",
    "body": "{\"email\":\"auth0-test@omitted.com\",\"email_verified\":true,\"connection\":\"Username-Password-Authentication\",\"verify_email\":false,\"app_metadata\":{\"applications\":{\"omitted\":[\"omitted\"]}},\"password\":\"omitted\",\"given_name\":\"Auth0\",\"family_name\":\"Test\",\"name\":\"Auth0 Test\"}",
    "headers": {
      "Content-Type": "application/json",
      "User-Agent": "Retool/2.0 (+https://docs.tryretool.com/docs/apis)",
      "Accept": "application/json",
      "Authorization": "---sanitized---",
    }

```

Note that there is `\"name\":\"Auth0 Test\"`, and we get a response of:

```json
  "response": {
    "data": {
      "created_at": "2023-08-25T16:13:07.297Z",
      "email": "auth0-test@omitted.com",
      "email_verified": true,
      "family_name": "Test",
      "given_name": "Auth0",
      "identities": [omitted],
      "name": "Auth0 Test",

```

so I know that Auth0 has the name _somewhere_.

Now, lets look at Action execution logs. The first line of my action is:

```javascript
exports.onExecutePostUserRegistration = async (event, api) => {
  console.log(`PostUserRegistration for user: ${JSON.stringify(event.user)}`)

```

and the log for this `post-user-registration` event is this:

```auto
PostUserRegistration for user: 
{
  "email": "auth0-test@omitted.com",
  "family_name": "Test",
  "given_name": "Auth0",
  "tenant": "omitted",
  "user_id": "auth0|64e8d313843778258e757bc4",
  "app_metadata": {
    "applications": {
      "omitted": [
        "omitted"
      ]
    }
  },
  "user_metadata": {},
  "email_verified": true,
  "phone_verified": false
}

```

See here that `name` is _not present_.

---

<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:** [August 28, 2023, 5:47pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/16 "2023-08-28T17:47:35Z")

</div>

Hi @patrick14,

Thanks for the update.

Could you please send me the name of your tenant and the user\_id as a direct message to look into this?

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![matt27](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/matt27/32/48798_2.png) [@matt27](https://community.auth0.com/u/matt27)\
**Post date:** [December 11, 2023, 7:32pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/17 "2023-12-11T19:32:19Z")

</div>

Hi there, I’m having the exact same issue with the post user registration action. I am using the API to create a Passwordless user, which works fine and the “name” field shows up fine in Auth0 and the API response, but the actual object I get from `event.user` does not have a `name` property. This really must be a bug in the Auth0 workflow. Can someone help here? I also do not have a given name or family name in my workflow so can’t use that workaround. Any help appreciated!

---

<div class="post-metadata">

**Author:** ![bdimonik](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bdimonik/32/48785_2.png) [@bdimonik](https://community.auth0.com/u/bdimonik)\
**Post date:** [March 18, 2024, 10:55am UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/18 "2024-03-18T10:55:12Z")

</div>

Hello. Any updates on this issue? Getting the same in a post signup action. No name, picture, creation date. But when getting to a client app, idToken has all this info.

---

<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:** [April 4, 2024, 10:41pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/19 "2024-04-04T22:41:14Z")

</div>

Hi @matt27 and @bdimonik,

It looks like the Post-User Registration Action is not printing the user’s `name` property regardless of creating a user with a `name`.

I have submitted this issue as a bug to our engineering teams and am waiting for a response. I’ll keep everybody posted on the updates.

Thanks,  
Rueben

---

<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:** [April 8, 2024, 6:14pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/21 "2024-04-08T18:14:18Z")

</div>

Hi everybody,

I have an update! After checking with our Engineering team, I was informed that the Post-User Registration does not contain the `user.name` property by design, despite what is stated in our documentation. I will follow up with our doc’s team to address this inconsistency.

As a workaround, you can query this information using the Management API in the Action to call the Get a User endpoint.

Please refer to the documentation below:

- [How can I use the Management API in Actions?](https://community.auth0.com/t/how-can-i-use-the-management-api-in-actions/64947)
- [UsersManager | auth0](https://auth0.github.io/node-auth0/classes/management.UsersManager.html#get)

Cheers!  
Rueben

---

<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:** [April 22, 2024, 6:14pm UTC](https://community.auth0.com/t/post-user-registration-user-does-not-have-user-name-property/107340/22 "2024-04-22T18:14:49Z")

</div>

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