aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command/User/AuthTokens
diff options
context:
space:
mode:
Diffstat (limited to 'core/Command/User/AuthTokens')
-rw-r--r--core/Command/User/AuthTokens/Add.php6
-rw-r--r--core/Command/User/AuthTokens/Delete.php3
-rw-r--r--core/Command/User/AuthTokens/ListCommand.php1
3 files changed, 6 insertions, 4 deletions
diff --git a/core/Command/User/AuthTokens/Add.php b/core/Command/User/AuthTokens/Add.php
index 43386b7709a..89b20535c63 100644
--- a/core/Command/User/AuthTokens/Add.php
+++ b/core/Command/User/AuthTokens/Add.php
@@ -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()) {
@@ -81,7 +81,7 @@ class Add extends Command {
$output->writeln('<info>No password provided. The generated app password will therefore have limited capabilities. Any operation that requires the login password will fail.</info>');
}
- $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS);
+ $token = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS);
$generatedToken = $this->tokenProvider->generateToken(
$token,
$user->getUID(),
diff --git a/core/Command/User/AuthTokens/Delete.php b/core/Command/User/AuthTokens/Delete.php
index 65c0147aa24..2047d2eae2a 100644
--- a/core/Command/User/AuthTokens/Delete.php
+++ b/core/Command/User/AuthTokens/Delete.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -46,7 +47,7 @@ class Delete extends Base {
protected function execute(InputInterface $input, OutputInterface $output): int {
$uid = $input->getArgument('uid');
- $id = (int) $input->getArgument('id');
+ $id = (int)$input->getArgument('id');
$before = $input->getOption('last-used-before');
if ($before) {
diff --git a/core/Command/User/AuthTokens/ListCommand.php b/core/Command/User/AuthTokens/ListCommand.php
index 1ebd4a0f0b4..b36aa717505 100644
--- a/core/Command/User/AuthTokens/ListCommand.php
+++ b/core/Command/User/AuthTokens/ListCommand.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later