fix(core): Make OC_PASS actually work for occ user:auth-tokens:add --password-from-env

Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
provokateurin 2025-06-20 11:20:37 +02:00 committed by backportbot[bot]
parent d02223b6cc
commit ab9328a17c

View file

@ -62,9 +62,9 @@ class Add extends Command {
}
if ($input->getOption('password-from-env')) {
$password = getenv('NC_PASS') ?? getenv('OC_PASS');
$password = getenv('NC_PASS') ?: getenv('OC_PASS');
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()) {