Post-login action not updating logs / omnisend

I’m using a post-login action to POST to omnisend with user first/last name, email, and tags.

If I run the action test in the auth0 action editor I receive all data in omnisend as expected.

On my live env though, I’m not receiving first/last name in omnisend, but I AM receiving email and tags in omnisend.

I do not see the action in the logs however I do see the successful new user creations with all the information as I’d expect it.

This feels like an async issue as the test data in the actions editor (I’m assuming) is probably generated synchronously while the deployment is async. I’m pretty thoroughly bamboozled at this point and am wondering if anyone can help me out!

Thank you!

oh finally someone else too has this problem. I thought i was doing something wrong with my actions configuration.
Sorry i don’t have a solution for this but if it helps, we are using hooks (old thing that predates Actions) and that works same as Actions. We can see logs in console, edit it in dashboard, add npm modules etc. But now for something new we decided to go with actions but its hard to test/debug when you don’t see execution logs.

It’s very odd, looking at the logs I can see given_name family_name etc coming in from the user signup, but the Omnisend profile only gets the email and tags

If it was an async issue I wouldn’t think I’d get any of the data :confused:

If you are using Lock form, then I assume you use additionalSignUpFields option to request given_name, family_name. If that’s the case, then maybe you have a problem here as these properties can land in 2 different places (in root or user_metadata object).

additionalSignUpFields: [
  {
    name: "given_name",
    storage: "root",
  },
  {
    name: "family_name",
    storage: "root",
  },
]

If you do not specify storage as root, then these properties will be added to user_metadata.
Here is some sample action code that you could try out:

exports.onExecutePostLogin = async (event, api) => {
  console.log("(EMAIL):", event.user.email);
  console.log("(NAME):", event.user.given_name);
  console.log("(SURNAME):", event.user.family_name);
  console.log("(META):", event.user.user_metadata);
  
  const axios = require('axios');
  
  try {
    const res = await axios.post('https://api.omnisend.com/v3/contacts', {
        "firstName": event.user.given_name,
        "lastName": event.user.family_name,
        "tags": [
            "test tag",
        ],
        "identifiers": [
        {
          "type": "email",
          "id": event.user.email,
          "channels": {
            "email": {
              "status": "subscribed",
              "statusDate": "2016-02-29T10:07:28Z"
            }
          }
        }
      ]
    }, {
      headers: {
        'Content-Type': 'application/json',
        'X-API-KEY': 'your_api_key'
      }
    });
    console.log(`statusCode: ${res.status}`);
  } catch (error) {
    console.log(error);
  }
};

You can see your action logs under Action Details tab in one of authentication type log details. And here under logs property you can see all console logs.