Action to Store the Auth0 user id in a remote system error

Hi there,

I am new to Auth0 and I am hoping to get some guidance on this.

I am trying to add new user info to my backend database when a new user signs up. I have followed the instructions to add an “Action” to “Post User Registration”, however, I am getting a 400 error. It says the request URL is “https://[domain]/u/signup?state=somethingsomething”.

const axios = require("axios");
exports.onExecutePostUserRegistration = async (event) => {
  await axios.post("http://localhost:1234/users", 
  { params: { email: event.user.email }});
};

I am not even sure where to debug? Could anyone please provide some guidance?

So this is solved. I actually was trying with an email that is already registered. Now the problem is that even with this action, I don’t see the request being sent out to the back end server…

When I use the “test” function in Actions, I get the following error:

Test Results
Error:
{
  "code": "ECONNREFUSED",
  "message": "connect ECONNREFUSED 127.0.0.1:1234",
  "name": "Error"
}

Hey team! :waving_hand:

Since this topic touches Auth0 Actions, quick heads-up that we’re hosting an Ask Me Anything dedicated to Actions with Gaston Danilo Asis Sanchez, Senior Technical Product Manager. We’ll cover practical usage, new capabilities like Transaction Metadata and Actions Types, plus a peek at what’s next. :sparkles:

  • Submit questions now through Aug 26 :writing_hand:
  • Get detailed written answers live on Aug 27, 9–11 AM PT :speech_balloon:

Earn community points + a badge :trophy:. If you’re exploring how Actions can streamline your auth flows, this is a great time to get direct guidance from the team.
Join the AMA & drop your questions here: August 27 Auth0 Community Ask Me Anything: Actions

Dawid