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 there!

As this topic is related to Actions and Rules & Hooks are being deprecated soon in favor of Actions, I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

Learn more here!