diff --git a/webapp/src/Command/ResetUserPasswordCommand.php b/webapp/src/Command/ResetUserPasswordCommand.php index a8080aee9e..b0cdfe38a2 100644 --- a/webapp/src/Command/ResetUserPasswordCommand.php +++ b/webapp/src/Command/ResetUserPasswordCommand.php @@ -33,6 +33,11 @@ protected function configure(): void 'username', InputArgument::REQUIRED, 'The username of the user to reset the password of' + ) + ->addArgument( + 'password', + InputArgument::OPTIONAL, + 'The new password; if not provided a random password is generated' ); } @@ -50,7 +55,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int return Command::FAILURE; } - $password = Utils::generatePassword(); + $password = $input->getArgument('password') ?? Utils::generatePassword(); $user->setPassword( $this->passwordHasher->hashPassword($user, $password)