Drupal-8-user-register-hook -

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

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 . drupal-8-user-register-hook

Use this to add custom fields or validation logic (e.g., matching a secondary database). 💻 Code Example: hook_user_presave To hook into the user registration process in

For cleaner, decoupled code, consider Symfony Event Subscribers if you are using the Hook Event Dispatcher module. checking an external blacklist)

This is the standard approach to identify a vs. an existing user being updated.