Skip to content

Commit

Permalink
fix: authenticated public links breaking upload
Browse files Browse the repository at this point in the history
Fixes an issue where opening public links in an authenticated context would prevent uploading resources.
  • Loading branch information
JammingBen committed Jun 28, 2023
1 parent 0b816ac commit 2e2985b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Authenticated public links breaking uploads

Opening public links in an authenticated context no longer breaks uploading resources.

https://github.com/owncloud/web/pull/9299
https://github.com/owncloud/web/issues/9298
2 changes: 2 additions & 0 deletions packages/web-runtime/src/services/auth/authService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export class AuthService {
if (publicLinkToken) {
await this.publicLinkManager.updateContext(publicLinkToken)
}
} else {
this.publicLinkManager.clearContext()
}

if (!this.userManager) {
Expand Down
6 changes: 6 additions & 0 deletions packages/web-runtime/src/services/auth/publicLinkManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ export class PublicLinkManager {
})
}

clearContext() {
this.store.commit('runtime/auth/SET_PUBLIC_LINK_CONTEXT', {
publicLinkContextReady: false
})
}

private async fetchCapabilities({ token = '', password = '' }): Promise<void> {
if (!isEmpty(this.store.getters.capabilities)) {
return
Expand Down

0 comments on commit 2e2985b

Please sign in to comment.