diff --git a/changelog/unreleased/bugfix-password-protected-public-link-capabilities b/changelog/unreleased/bugfix-password-protected-public-link-capabilities new file mode 100644 index 00000000000..2120989da6a --- /dev/null +++ b/changelog/unreleased/bugfix-password-protected-public-link-capabilities @@ -0,0 +1,6 @@ +Bugfix: Load capabilities for password protected public links + +We've enabled capability loading for password protected public links. + +https://github.com/owncloud/web/pull/6471 +https://github.com/owncloud/web/issues/5863 diff --git a/packages/web-app-files/src/views/PublicFiles.vue b/packages/web-app-files/src/views/PublicFiles.vue index d2124e07fd6..7b91cc8e3f9 100644 --- a/packages/web-app-files/src/views/PublicFiles.vue +++ b/packages/web-app-files/src/views/PublicFiles.vue @@ -66,7 +66,7 @@ import MixinMountSideBar from '../mixins/sidebar/mountSideBar' import { VisibilityObserver } from 'web-pkg/src/observer' import { ImageDimension, ImageType } from '../constants' import debounce from 'lodash-es/debounce' -import merge from 'lodash-es/merge' +import omit from 'lodash-es/omit' import { buildResource } from '../helpers/resources' import { bus } from 'web-pkg/src/instance' import { useTask } from 'vue-concurrency' @@ -96,10 +96,6 @@ const unauthenticatedUserReady = async (router, store) => { const publicToken = (router.currentRoute.params.item || '').split('/')[0] const publicLinkPassword = store.getters['Files/publicLinkPassword'] - if (publicLinkPassword) { - return - } - await store.dispatch('loadCapabilities', { publicToken, ...(publicLinkPassword && { user: 'public', password: publicLinkPassword }) @@ -107,11 +103,12 @@ const unauthenticatedUserReady = async (router, store) => { // ocis at the moment is not able to create archives for public links that are password protected // till this is supported by the backend remove it hard as a workaround + // https://github.com/owncloud/web/issues/6515 if (publicLinkPassword) { - store.commit( - 'SET_CAPABILITIES', - merge({}, store.getters.capabilities, { files: { archivers: null } }) - ) + store.commit('SET_CAPABILITIES', { + capabilities: omit(store.getters.capabilities, ['files.archivers']), + version: store.getters.version + }) } store.commit('SET_USER_READY', true) @@ -197,7 +194,7 @@ export default { } } - // this is a workAround till we have a real bootProcess + // this is a workAround till we have extended the bootProcess // if a visitor is able to view the current page // the user is ready and the TOO LATE provisioning can start. // there is no other way at the moment to find out if: