Skip to content

Commit f6be7fd

Browse files
nykopolstof
authored andcommitted
Hide user password in CLI if possible
1 parent 6596b9d commit f6be7fd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Command/ChangePasswordCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ function($username) {
8383
}
8484

8585
if (!$input->getArgument('password')) {
86-
$password = $this->getHelper('dialog')->askAndValidate(
86+
$askingMethod = method_exists($this->getHelper('dialog'), 'askHiddenResponseAndValidate') ? 'askHiddenResponseAndValidate' : 'askAndValidate';
87+
$password = $this->getHelper('dialog')->$askingMethod(
8788
$output,
8889
'Please enter the new password:',
8990
function($password) {

Command/CreateUserCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ function($email) {
115115
}
116116

117117
if (!$input->getArgument('password')) {
118-
$password = $this->getHelper('dialog')->askAndValidate(
118+
$askingMethod = method_exists($this->getHelper('dialog'), 'askHiddenResponseAndValidate') ? 'askHiddenResponseAndValidate' : 'askAndValidate';
119+
$password = $this->getHelper('dialog')->$askingMethod(
119120
$output,
120121
'Please choose a password:',
121122
function($password) {

0 commit comments

Comments
 (0)