Drupal-8-user-register-hook -
Inside presave , always call $user->isNew() to ensure your code only runs during initial registration rather than every time a profile is updated.
[Solved] How to hook into Commerce after payment complete - Drupal drupal-8-user-register-hook
For cleaner, decoupled code, consider Symfony Event Subscribers if you are using the Hook Event Dispatcher module. Inside presave , always call $user->isNew() to ensure
The most effective way to intercept or modify user data during registration is through the following hooks: Usage Note Runs before the user is saved. drupal-8-user-register-hook
This is the standard approach to identify a vs. an existing user being updated.