From 1e4f6af9df71917901c8aa71cf842c3f8ddab3bc Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 16 Jan 2025 12:00:09 -0300 Subject: [PATCH] fix: handle settings after backend upgrade Signed-off-by: Vitor Mattos --- lib/Controller/FileController.php | 6 ++++++ src/views/CreatePassword.vue | 4 ++-- src/views/ReadCertificate.vue | 4 ++-- src/views/ResetPassword.vue | 4 ++-- src/views/Settings/CollectMetadata.vue | 3 ++- src/views/Settings/Validation.vue | 9 ++++++--- 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/lib/Controller/FileController.php b/lib/Controller/FileController.php index 79ff8f2e4c..340ebfe142 100644 --- a/lib/Controller/FileController.php +++ b/lib/Controller/FileController.php @@ -51,6 +51,7 @@ use OCP\Files\File; use OCP\Files\Node; use OCP\Files\NotFoundException; +use OCP\IAppConfig; use OCP\IL10N; use OCP\IPreview; use OCP\IRequest; @@ -80,6 +81,7 @@ public function __construct( private RequestSignatureService $requestSignatureService, private AccountService $accountService, private IPreview $preview, + private IAppConfig $appConfig, private IMimeIconProvider $mimeIconProvider, private FileService $fileService, private ValidateHelper $validateHelper, @@ -194,6 +196,10 @@ public function validateBinary(): DataResponse { #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/file/validate/', requirements: ['apiVersion' => '(v1)'])] public function validate(?string $type = null, $identifier = null): DataResponse { try { + $isValidationUrlPrivate = (bool)$this->appConfig->getValueBool(Application::APP_ID, 'make_validation_url_private', false); + if ($isValidationUrlPrivate) { + throw new LibresignException($this->l10n->t('You are not logged in. Please log in.')); + } if ($type === 'Uuid' && !empty($identifier)) { try { $this->fileService diff --git a/src/views/CreatePassword.vue b/src/views/CreatePassword.vue index d10c81ea2a..77f4c1b821 100644 --- a/src/views/CreatePassword.vue +++ b/src/views/CreatePassword.vue @@ -12,8 +12,8 @@