- Issue created by @Anybody
Automatically closed - issue fixed for 2 weeks with no activity.
// Only proceed if the user is not an admin user ($account->isNew() will
// return FALSE here, so we don't check it):
if (in_array('administrator', $account->getRoles())) {
return;
}
is wrong, not only administrators can create new user accounts!
Here are some examples from similar modules:
https://git.drupalcode.org/project/registration_role/-/blob/8.x-1.x/regi...
https://git.drupalcode.org/project/redirect_after_registration/-/blob/1....
I'd vote for a simple solution:
\Drupal::currentUser()->isAnonymous()
Please note that we check for the current user, not the user account that was created.
Active
1.0
Code
Automatically closed - issue fixed for 2 weeks with no activity.