Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 6 additions & 1 deletion packages/web-pkg/src/composables/piniaStores/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const useAuthStore = defineStore('auth', () => {
const userContextReady = ref(false)
const publicLinkToken = ref<string>()
const publicLinkPassword = ref<string>()
const publicLinkPasswordRequired = ref<boolean>()
const publicLinkType = ref<string>()
const publicLinkContextReady = ref(false)

Expand All @@ -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 = () => {
Expand All @@ -42,7 +45,8 @@ export const useAuthStore = defineStore('auth', () => {
publicLinkToken: null,
publicLinkPassword: null,
publicLinkType: null,
publicLinkContextReady: false
publicLinkContextReady: false,
publicLinkPasswordRequired: null
})
}

Expand All @@ -54,6 +58,7 @@ export const useAuthStore = defineStore('auth', () => {
publicLinkPassword,
publicLinkType,
publicLinkContextReady,
publicLinkPasswordRequired,

setAccessToken,
setIdpContextReady,
Expand Down
4 changes: 4 additions & 0 deletions packages/web-runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
{},
Expand Down
3 changes: 2 additions & 1 deletion packages/web-runtime/src/services/auth/publicLinkManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}

Expand Down