# wix-members-backend authentication.register() isn't storing any of my custom fields

**URL:** <https://forum.wixstudio.com/t/wix-members-backend-authentication-register-isnt-storing-any-of-my-custom-fields/34047>\
**Category:** Ask the community\
**Tags:** wix-members-area, code, wix-stores, question\
**Created:** [October 12, 2022, 3:48am UTC](https://forum.wixstudio.com/t/wix-members-backend-authentication-register-isnt-storing-any-of-my-custom-fields/34047 "2022-10-12T03:48:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfabdoellah](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/rfabdoellah/32/31029_2.png) [@rfabdoellah](https://forum.wixstudio.com/u/rfabdoellah)\
**Post date:** [October 12, 2022, 3:48am UTC](https://forum.wixstudio.com/t/wix-members-backend-authentication-register-isnt-storing-any-of-my-custom-fields/34047/1 "2022-10-12T03:48:38Z")

</div>

Hello. I’ve had a somewhat similar problem before where authentication.register() wasn’t saving birthdates. I’ve just rechecked my site and now it seems it’s not saving ANY custom field when called. Docs say passing an object containing additional user data in the third argument should work but it’s not.

below is my register function

```javascript
export async function doRegistration(email, pw, payload) {

    const { contactInfo, page, birthdate } = payload
    const resOptions = {
        contactInfo,
    }

    //create label array
    const labelKeys = ["label 1"]

    //add labels based on registration answers
    if(contactInfo["custom field 1"] == "yes") {
        labelKeys.push("label 2")
    } else {
        labelKeys.push("label 3")
    }

    if(contactInfo["custom field 2"] == "yes") {
        labelKeys.push("label 4")
    }
    resOptions.contactInfo["labels"] = labelKeys

    console.log("registration object being passed: ",resOptions)
    try {
        // resOptions looks like: {"contactInfo:{"firstName":"test","lastName":"test","birthdate":"2022-10-01","customFieldNoSpace":"test","custom field 1":"yes","custom field 2":"yes","labels":["label 1","label 2","label 4"]},}
        const res = await authentication.register(email, pw, resOptions)
        console.log("register success", res)
        
        // send confirmation email
        await triggeredEmails.emailMember('confirmationEmail', res.member._id, {
            variables: {
                confirmUrl: `url?tk=${res.approvalToken}&pg=${page}`,
                tk: res.approvalToken,
                pg: page,
            }
        })
        return res
    }catch (error){
        console.error(error)
        return error.message.toString().includes("already exists") ? "Email already exists" : error.toString()
    }
}

```

when I check in contacts, the only thing that’s stored is the user’s name and email. none of the additional details is saved.

Am I passing the wrong key:value pairs? Is it expecting something similar to the contacts API where custom fields are under an extendedFields key? My code was working as until the end of September. I noticed many new users did not have any custom field values.

---

<div class="post-metadata">

**Author:** ![rfabdoellah](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/rfabdoellah/32/31029_2.png) [@rfabdoellah](https://forum.wixstudio.com/u/rfabdoellah)\
**Post date:** [October 13, 2022, 12:54am UTC](https://forum.wixstudio.com/t/wix-members-backend-authentication-register-isnt-storing-any-of-my-custom-fields/34047/2 "2022-10-13T00:54:54Z")

</div>

UPDATE: Birthdates still won’t save, but I was able to save my custom fields. I used the custom field key instead of the custom field name and that seems to have fixed it.

So instead of having the passed object like:

```javascript
{
  "contactInfo:{
    "firstName":"test",
    "lastName":"test",
    "birthdate":"2022-10-01",
    "customField 1":"test",
    "custom field 2":"yes",
    "custom field 3":"yes",
    "labels":["label 1","label 2","label 4"]
   },
}

```

I had:

```javascript
{
  "contactInfo:{
    "firstName":"test",
    "lastName":"test",
    "birthdate":"2022-10-01",
    "customField-key-1":"test",
    "custom-field-key-2":"yes",
    "custom-field-key-3":"yes",
    "labels":["label 1","label 2","label 4"]
   },
}

```

I had to do a run queryExtendedFields to figure out what my custom field keys were
