diff --git a/packages/web-runtime/src/composables/tokenInfo/useLoadTokenInfo.ts b/packages/web-runtime/src/composables/tokenInfo/useLoadTokenInfo.ts index 975d614af0a..ce4ca4e6d34 100644 --- a/packages/web-runtime/src/composables/tokenInfo/useLoadTokenInfo.ts +++ b/packages/web-runtime/src/composables/tokenInfo/useLoadTokenInfo.ts @@ -8,14 +8,20 @@ export function useLoadTokenInfo(token) { const isUserContext = useUserContext({ store }) const loadTokenInfoTask = useTask(function* () { + let tokenInfo + try { if (unref(isUserContext)) { - return yield owncloudSdk.shares.getProtectedTokenInfo(token) + tokenInfo = yield owncloudSdk.shares.getProtectedTokenInfo(token) } else { - return yield owncloudSdk.shares.getUnprotectedTokenInfo(token) + tokenInfo = yield owncloudSdk.shares.getUnprotectedTokenInfo(token) } } catch (e) {} // backend doesn't support the token info endpoint - return {} + return { + ...tokenInfo, + alias_link: tokenInfo.alias_link === 'true', + password_protected: tokenInfo.password_protected === 'true' + } }) return { loadTokenInfoTask } diff --git a/packages/web-runtime/src/pages/resolvePublicLink.vue b/packages/web-runtime/src/pages/resolvePublicLink.vue index 95c6320dd35..eda944eeb24 100644 --- a/packages/web-runtime/src/pages/resolvePublicLink.vue +++ b/packages/web-runtime/src/pages/resolvePublicLink.vue @@ -105,7 +105,7 @@ export default defineComponent({ })) const isPasswordRequiredTask = useTask(function* (signal, ref) { if (!isEmpty(ref.tokenInfo)) { - return ref.tokenInfo.password_protected === 'true' + return ref.tokenInfo.password_protected } try { yield webdav.getFileInfo({ ...unref(publicLinkSpace), publicLinkPassword: null })