According to the documentation create_user command creates the new user with only the username and email fields propagated, so the user will be forced to create a password at first login attempt.
But if we have a look to the code of CreateUser.php file:
public function run(array $params = [])
{
$row = [
'active' => 1,
'password' => bin2hex(random_bytes(24)),
];
$row['username'] = array_shift($params);
if (empty($row['username'])) {
$row['username'] = CLI::prompt('Username', null, 'required');
}
$row['email'] = array_shift($params);
if (empty($row['email'])) {
$row['email'] = CLI::prompt('Email', null, 'required');
}
$user = new User($row);
$users = model(UserModel::class);
if ($userId = $users->insert($user)) {
// rest of code ...
}
value for the 'force_pass_reset' not set. Default value is 0.
I think we should add $user->forcePasswordReset(); before to save.
According to the documentation create_user command creates the new user with only the
username
andemail
fields propagated, so the user will be forced to create a password at first login attempt. But if we have a look to the code of CreateUser.php file:value for the 'force_pass_reset' not set. Default value is 0. I think we should add $user->forcePasswordReset(); before to save.