Drupal-8-user-register-hook

If you need to stop registration based on custom business logic (e.g., checking an external blacklist), use a custom validation handler via hook_form_alter .

Best for modifying data (e.g., adding a default role) before it hits the database. Runs after the user is created. drupal-8-user-register-hook

Use this for actions that require the new User ID, like sending a custom welcome email or creating related profile entries. Modifies the registration form . If you need to stop registration based on

To hook into the user registration process in Drupal 8 (and 9/10+), you typically use entity hooks since users are treated as content entities. 🛠️ Recommended Hooks checking an external blacklist)