diff --git a/app/Console/Commands/CreateAdmin.php b/app/Console/Commands/CreateAdmin.php index d7acd56..425f7a8 100644 --- a/app/Console/Commands/CreateAdmin.php +++ b/app/Console/Commands/CreateAdmin.php @@ -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;