Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/Command/User/Add.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
'password-from-env',
null,
InputOption::VALUE_NONE,
'read password from environment variable OC_PASS'
'read password from environment variable NC_PASS/OC_PASS'
)
->addOption(
'generate-password',
Expand Down Expand Up @@ -91,10 +91,10 @@

// Setup password.
if ($input->getOption('password-from-env')) {
$password = getenv('OC_PASS');
$password = getenv('NC_PASS') ?: getenv('OC_PASS');

Check notice

Code scanning / Psalm

RiskyTruthyFalsyComparison Note

Operand of type false|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead.

if (!$password) {
$output->writeln('<error>--password-from-env given, but OC_PASS is empty!</error>');
$output->writeln('<error>--password-from-env given, but NC_PASS/OC_PASS is empty!</error>');
return 1;
}
} elseif ($input->getOption('generate-password')) {
Expand Down
4 changes: 2 additions & 2 deletions core/Command/User/AuthTokens/Add.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
}

if ($input->getOption('password-from-env')) {
$password = getenv('NC_PASS') ?? getenv('OC_PASS');
$password = getenv('NC_PASS') ?: getenv('OC_PASS');

Check notice

Code scanning / Psalm

RiskyTruthyFalsyComparison Note

Operand of type false|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead.
if (!$password) {
$output->writeln('<error>--password-from-env given, but NC_PASS is empty!</error>');
$output->writeln('<error>--password-from-env given, but NC_PASS/OC_PASS is empty!</error>');
return 1;
}
} elseif ($input->isInteractive()) {
Expand Down
6 changes: 3 additions & 3 deletions core/Command/User/ResetPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
'password-from-env',
null,
InputOption::VALUE_NONE,
'read password from environment variable OC_PASS'
'read password from environment variable NC_PASS/OC_PASS'
)
;
}
Expand All @@ -56,9 +56,9 @@
}

if ($input->getOption('password-from-env')) {
$password = getenv('OC_PASS');
$password = getenv('NC_PASS') ?: getenv('OC_PASS');

Check notice

Code scanning / Psalm

RiskyTruthyFalsyComparison Note

Operand of type false|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead.
if (!$password) {
$output->writeln('<error>--password-from-env given, but OC_PASS is empty!</error>');
$output->writeln('<error>--password-from-env given, but NC_PASS/OC_PASS is empty!</error>');
return 1;
}
} elseif ($input->isInteractive()) {
Expand Down
Loading