From 747607b939584c5bd8229bdc1abd70ece50b778f Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Wed, 13 Nov 2024 13:09:07 +0100 Subject: [PATCH] fix: file picker when embed delegate authentication is enabled Fixes the "Open" and "Save as" actions when the server has enabled `embed.delegateAuthentication`. This flag needs to be ignored for these 2 actions since Web is basically embedding itself and always needs authentication. --- ...bugfix-save-as-open-action-embed-delegate-authentication | 6 ++++++ packages/web-pkg/src/components/Modals/FilePickerModal.vue | 1 + packages/web-pkg/src/components/Modals/SaveAsModal.vue | 1 + .../tests/unit/components/Modals/FilePickerModal.spec.ts | 2 +- .../tests/unit/components/Modals/SaveAsModal.spec.ts | 2 +- 5 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/bugfix-save-as-open-action-embed-delegate-authentication diff --git a/changelog/unreleased/bugfix-save-as-open-action-embed-delegate-authentication b/changelog/unreleased/bugfix-save-as-open-action-embed-delegate-authentication new file mode 100644 index 00000000000..ebe9da7b421 --- /dev/null +++ b/changelog/unreleased/bugfix-save-as-open-action-embed-delegate-authentication @@ -0,0 +1,6 @@ +Bugfix: "Save as" / "Open" when embed delegate authentication is enabled + +We've fixed the "Save as" / "Open" actions when embed delegate authentication is enabled on the server side. + +https://github.com/owncloud/web/issues/11897 +https://github.com/owncloud/web/pull/11899 diff --git a/packages/web-pkg/src/components/Modals/FilePickerModal.vue b/packages/web-pkg/src/components/Modals/FilePickerModal.vue index 657f3730bd9..8401f855f55 100644 --- a/packages/web-pkg/src/components/Modals/FilePickerModal.vue +++ b/packages/web-pkg/src/components/Modals/FilePickerModal.vue @@ -58,6 +58,7 @@ export default defineComponent({ iframeUrl.searchParams.append('hide-logo', 'true') iframeUrl.searchParams.append('embed', 'true') iframeUrl.searchParams.append('embed-target', 'file') + iframeUrl.searchParams.append('embed-delegate-authentication', 'false') iframeUrl.searchParams.append('embed-file-types', availableFileTypes.join(',')) const onLoad = () => { diff --git a/packages/web-pkg/src/components/Modals/SaveAsModal.vue b/packages/web-pkg/src/components/Modals/SaveAsModal.vue index 612ebd34304..a3cc736ca07 100644 --- a/packages/web-pkg/src/components/Modals/SaveAsModal.vue +++ b/packages/web-pkg/src/components/Modals/SaveAsModal.vue @@ -63,6 +63,7 @@ export default defineComponent({ iframeUrl.searchParams.append('embed', 'true') iframeUrl.searchParams.append('embed-target', 'location') iframeUrl.searchParams.append('embed-choose-file-name', 'true') + iframeUrl.searchParams.append('embed-delegate-authentication', 'false') iframeUrl.searchParams.append('embed-choose-file-name-suggestion', props.originalResource.name) const onLoad = () => { diff --git a/packages/web-pkg/tests/unit/components/Modals/FilePickerModal.spec.ts b/packages/web-pkg/tests/unit/components/Modals/FilePickerModal.spec.ts index 553f9390592..10b9be2be46 100644 --- a/packages/web-pkg/tests/unit/components/Modals/FilePickerModal.spec.ts +++ b/packages/web-pkg/tests/unit/components/Modals/FilePickerModal.spec.ts @@ -12,7 +12,7 @@ describe('FilePickerModal', () => { it('sets the iframe src correctly', () => { const { wrapper } = getWrapper() expect(wrapper.vm.iframeSrc).toEqual( - 'http://localhost:3000/files-spaces-generic?hide-logo=true&embed=true&embed-target=file&embed-file-types=text%2Cmd%2Ctext%2Frtf' + 'http://localhost:3000/files-spaces-generic?hide-logo=true&embed=true&embed-target=file&embed-delegate-authentication=false&embed-file-types=text%2Cmd%2Ctext%2Frtf' ) }) it('sets the iframe title correctly', () => { diff --git a/packages/web-pkg/tests/unit/components/Modals/SaveAsModal.spec.ts b/packages/web-pkg/tests/unit/components/Modals/SaveAsModal.spec.ts index d5f7cbabdf0..b6cc595a85f 100644 --- a/packages/web-pkg/tests/unit/components/Modals/SaveAsModal.spec.ts +++ b/packages/web-pkg/tests/unit/components/Modals/SaveAsModal.spec.ts @@ -18,7 +18,7 @@ describe('SaveAsModal', () => { it('sets the iframe src correctly', () => { const { wrapper } = getWrapper() expect(wrapper.vm.iframeSrc).toEqual( - 'http://localhost:3000/files-spaces-generic?hide-logo=true&embed=true&embed-target=location&embed-choose-file-name=true&embed-choose-file-name-suggestion=test.txt' + 'http://localhost:3000/files-spaces-generic?hide-logo=true&embed=true&embed-target=location&embed-choose-file-name=true&embed-delegate-authentication=false&embed-choose-file-name-suggestion=test.txt' ) }) it('sets the iframe title correctly', () => {