Auto activation of user on sign up

Hi,

I’m using auth0 API /dbconnections/signup to register users.

I would like to know how can I customize the flow of the sign (not login) up to do the following:

  • set is_active to be equals to true, by default

  • Disable verification message

  • Send an API request to my server with the registered user information payload

  • Send a welcome message with a link to the app

Is there a way to accomplish the required sign-up flow?

Hi @joaqra,

Welcome to the Community!

You can use a pre-user registration action to set this data in the user’s metadata:

/**
 * @param {Event} event - Details about registration event.
 * @param {PreUserRegistrationAPI} api
 */
exports.onExecutePreUserRegistration = async (event, api) => {
  api.user.setUserMetadata("is_active", true);  
};

You can disable the verification email in your Auth0 dashboard (Branding > Email Templates:

)

You can use a post-user-registration action for this:

const axios = require("axios");

/**
 * @param {Event} event - Details about registration event.
 */
exports.onExecutePostUserRegistration = async (event) => {
  await axios.get("https://my-api.exampleco.com/users", { params: { email: event.user.email }});
};

You can customize the welcome email after configuring an email provider in your Auth0 dashboard (Branding > Email Templates):

https://auth0.com/docs/email/customize-email-templates

1 Like

Thank you so much!! :heart_eyes:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.