Is it Possible to Use a Post-User Registration Action (or Hook) to Update a User

Last Updated: Sep 27, 2024

Overview

This article explains whether is possible to use a Post User Registration action to update a user’s profile.

Applies To

  • Actions
  • Users

Solution

It is not possible to use a Post User Registration Action to update a user. To make changes to the user when they sign up, such as assigning a role or adding metadata, it’s best to use a pre-user-registration or post-login action instead.

The post-user registration action trigger is designed to notify another system that a user has registered for the application. Use this type of action to execute asynchronous tasks, such as adding a user ID to an external system or sending a Slack notification.

Here are a couple of things to keep in mind when considering this type of action or hook:

  • The post-user registration action will only run for Passwordless or Database users. This action will not execute when users from other types of connections log in to the app for the first time. For example, the action will not run when a user logs in with a social connection such as Google.
  • It’s recommended not to use the post-user registration action to make changes to the user. For example, it’d be best not to use a post-user registration action for assigning roles or updating user metadata, as the user may not be available when the action runs. For tasks that involve modifying the user in Auth0, use a pre-user registration or post-login action instead.

Related References

3 Likes