Skip to content

Commit 484ba5e

Browse files
committed
If user password set command is run in non-interactive mode, show a warning message if no password is inputted
Related to issue #748
1 parent b42d98e commit 484ba5e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Command/User/SetPasswordCommand.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8383

8484
while (!$success) {
8585
$pw1 = $io->askHidden('Please enter new password:');
86+
87+
if ($pw1 === null) {
88+
$io->error('No password entered! Please try again.');
89+
90+
//If we are in non-interactive mode, we can not ask again
91+
if (!$input->isInteractive()) {
92+
$io->warning('Non-interactive mode detected. No password can be entered that way! If you are using docker exec, please use -it flag.');
93+
return Command::FAILURE;
94+
}
95+
96+
continue;
97+
}
98+
8699
$pw2 = $io->askHidden('Please confirm:');
87100
if ($pw1 !== $pw2) {
88101
$io->error('The entered password did not match! Please try again.');

0 commit comments

Comments
 (0)