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

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

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.

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:

{
  "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:

{
  "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