Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[full-ci] Resolve alias links #7405

Merged
merged 5 commits into from
Oct 11, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix resolving of password protected links
  • Loading branch information
JammingBen committed Oct 11, 2022
commit 190685f800df7fb4a2f453b05e183f406de40a06
17 changes: 13 additions & 4 deletions packages/web-runtime/src/composables/tokenInfo/useLoadTokenInfo.ts
Original file line number Diff line number Diff line change
@@ -8,14 +8,23 @@ 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 {}
} 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 }
2 changes: 1 addition & 1 deletion packages/web-runtime/src/pages/resolvePublicLink.vue
Original file line number Diff line number Diff line change
@@ -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 })