fix return

This commit is contained in:
aynsix
2020-03-03 12:12:44 +03:00
parent bb356e206f
commit 354b1b8e6e

View File

@@ -123,11 +123,17 @@ class UserPasswordCommand extends Command
if (($password || $generate || $getHash) && $oldHash) { if (($password || $generate || $getHash) && $oldHash) {
if ($jsonformat) { if ($jsonformat) {
if ($password) {
$hash['new_password'] = $password;
}
$hash['password_hash'] = $oldHash; $hash['password_hash'] = $oldHash;
$hash['nonce'] = $oldNonce; $hash['nonce'] = $oldNonce;
echo json_encode($hash); echo json_encode($hash);
} else { } else {
if ($password) {
$output->writeln('<info>new_password :</info>' . $password);
}
$output->writeln('<info>password_hash :</info>' . $oldHash); $output->writeln('<info>password_hash :</info>' . $oldHash);
$output->writeln('<info>nonce :</info>' . $oldNonce); $output->writeln('<info>nonce :</info>' . $oldNonce);
} }