From 82d66bf2343bd578ea7315eed5578f1d7c6c404a Mon Sep 17 00:00:00 2001 From: Kent Delante Date: Tue, 20 Jan 2026 09:46:35 +0800 Subject: [PATCH] feat(occ): allow admins to clear account passwords Signed-off-by: Kent Delante --- core/Command/User/ResetPassword.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/Command/User/ResetPassword.php b/core/Command/User/ResetPassword.php index c1759533d3996..7fc789364bd55 100644 --- a/core/Command/User/ResetPassword.php +++ b/core/Command/User/ResetPassword.php @@ -43,6 +43,12 @@ protected function configure() { InputOption::VALUE_NONE, 'read password from environment variable NC_PASS/OC_PASS' ) + ->addOption( + 'no-password', + null, + InputOption::VALUE_NONE, + 'Sets the password to blank' + ) ; } @@ -61,6 +67,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln('--password-from-env given, but NC_PASS/OC_PASS is empty!'); return 1; } + } elseif ($input->getOption('no-password')) { + $password = ''; } elseif ($input->isInteractive()) { /** @var QuestionHelper $helper */ $helper = $this->getHelper('question');