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