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 29, 2023
1 parent fcce10f commit 0c09f07
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
@@ -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
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
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 0c09f07

Please sign in to comment.