create admin add confir password

This commit is contained in:
Jérémy Munsch 2023-05-11 09:18:36 +02:00
parent 99548a0c84
commit 5746177b73
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC

View file

@ -36,7 +36,7 @@ class CreateAdmin extends Command
try {
$tmp = $this->ask('Type the wanted user email', 'equipe.web@ldc.fr');
$validator = Validator::make(['email' => $tmp], [
'email' => 'required|unique:users,email|email:rfc,dns'
'email' => 'required|unique:users,email|email:rfc,spoof'
]);
$validator->validate();
$email = $tmp;
@ -84,7 +84,14 @@ class CreateAdmin extends Command
}
}
$password = $this->secret('Type the wanted user password');
$password = null;
while (
($password = $this->secret(
(!\is_null($password) ? 'Failed to confirm, ' : '') . 'Type the wanted user password'
)) !== $this->secret('Confirm the password')
) {
continue;
}; //end while
$user = new User();
$user->firstname = $firstname;