From 93719f1c50b23f5564befec2dae4dc7865920ac3 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 0efb5d608a..a30522e869 100644 --- a/lib/Controller/FileController.php +++ b/lib/Controller/FileController.php @@ -35,6 +35,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; @@ -64,6 +65,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, @@ -178,6 +180,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 b71b65f24f..1abedde842 100644 --- a/src/views/CreatePassword.vue +++ b/src/views/CreatePassword.vue @@ -16,8 +16,8 @@