diff --git a/packages/web-pkg/src/composables/piniaStores/auth.ts b/packages/web-pkg/src/composables/piniaStores/auth.ts index 7ab0efe0144..7ffbfc7562a 100644 --- a/packages/web-pkg/src/composables/piniaStores/auth.ts +++ b/packages/web-pkg/src/composables/piniaStores/auth.ts @@ -7,6 +7,7 @@ export const useAuthStore = defineStore('auth', () => { const userContextReady = ref(false) const publicLinkToken = ref() const publicLinkPassword = ref() + const publicLinkPasswordRequired = ref() const publicLinkType = ref() const publicLinkContextReady = ref(false) @@ -24,11 +25,13 @@ export const useAuthStore = defineStore('auth', () => { publicLinkPassword: string publicLinkType: string publicLinkContextReady: boolean + publicLinkPasswordRequired: boolean }) => { publicLinkToken.value = context.publicLinkToken publicLinkPassword.value = context.publicLinkPassword publicLinkType.value = context.publicLinkType publicLinkContextReady.value = context.publicLinkContextReady + publicLinkPasswordRequired.value = context.publicLinkPasswordRequired } const clearUserContext = () => { @@ -42,7 +45,8 @@ export const useAuthStore = defineStore('auth', () => { publicLinkToken: null, publicLinkPassword: null, publicLinkType: null, - publicLinkContextReady: false + publicLinkContextReady: false, + publicLinkPasswordRequired: null }) } @@ -54,6 +58,7 @@ export const useAuthStore = defineStore('auth', () => { publicLinkPassword, publicLinkType, publicLinkContextReady, + publicLinkPasswordRequired, setAccessToken, setIdpContextReady, diff --git a/packages/web-runtime/src/index.ts b/packages/web-runtime/src/index.ts index 6b1d9549b90..bc2b3fd4cc9 100644 --- a/packages/web-runtime/src/index.ts +++ b/packages/web-runtime/src/index.ts @@ -276,6 +276,10 @@ export const bootstrapApp = async (configurationPath: string, appsReadyCallback: }) try { + // Return early if the password is required. Let the resolvePublicLink.`verifyPassword` handle that. + if (authStore.publicLinkPasswordRequired) { + return + } const loadedSpace = await clientService.webdav.getFileInfo( space, {}, diff --git a/packages/web-runtime/src/services/auth/publicLinkManager.ts b/packages/web-runtime/src/services/auth/publicLinkManager.ts index 5b68b5b60e4..145add6a88d 100644 --- a/packages/web-runtime/src/services/auth/publicLinkManager.ts +++ b/packages/web-runtime/src/services/auth/publicLinkManager.ts @@ -106,7 +106,8 @@ export class PublicLinkManager { publicLinkToken: token, publicLinkPassword: password, publicLinkContextReady: true, - publicLinkType: this.getType(token) + publicLinkType: this.getType(token), + publicLinkPasswordRequired: this.isPasswordRequired(token) }) }