πŸ‡·πŸ‡ΊRussia @vladimir.krupin

Account created on 12 January 2016, over 8 years ago
#

Recent comments

πŸ‡·πŸ‡ΊRussia vladimir.krupin

#10 Now is not possible to send pass data. This case checked before temporary password generation inside the protected function ensureAccountCanRegister

    if (!$this->userSettings->get('verify_mail')) {
      if (empty($account->getPassword())) {
        // If no e-mail verification then the user must provide a password.
        throw new UnprocessableEntityHttpException('No password provided.');
      }
    }
    else {
      if (!empty($account->getPassword())) {
        // If e-mail verification required then a password cannot provided.
        // The password will be set when the user logs in.
        throw new UnprocessableEntityHttpException('A Password cannot be specified. It will be generated on login.');
      }
    }

Also, \Drupal\Tests\user\Functional\RestRegisterUserTest have related case inside testRegisterUser()

      // Attempt to register with a password when e-mail verification is on.
    $config->set('register', UserInterface::REGISTER_VISITORS);
    $config->set('verify_mail', 1);
    $config->save();
    $response = $this->registerRequest('Estraven', TRUE);
    $this->assertResourceErrorResponse(422, 'A Password cannot be specified. It will be generated on login.', $response);

Is this the answer to your question?

πŸ‡·πŸ‡ΊRussia vladimir.krupin

Required email verification should affect the user password, not the user status.
Patch attached

Production build 0.69.0 2024