Sub-folder sharing fix#1148
Open
alexkoon wants to merge 1 commit into
Open
Conversation
0d532f5 to
36654d8
Compare
Author
|
Force pushed over with fixes for the tests - these were the changes to the tests Test fixes src/frontend/app/ui/gallery/gallery.component.spec.ts test/cypress/e2e/share.cy.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WARNING - This was vibe coded. I am a Java dev, and don't really know typescript. I had a Claude sub so wanted to apply it to this as I use pigallery2. I have tested (not extensively) via a local build docker image.
Fix: Subfolder navigation now works for shared folder links
This fixes the regression reported in Discussion #1068 where shared folder links no longer allowed recipients to browse into subfolders.
What was broken and what was fixed:
when a folder is shared, all its subdirectories are included in the allowed content projection.
causes:
- NavigationService.toLogin() was awaiting the currentSharing observable to determine whether to show the password prompt — but that observable only emits after authentication, creating a deadlock. Fixed by exposing
passwordProtected from the public /share//key endpoint (no auth required) so the redirect decision can be made synchronously.
- error.interceptor.ts was calling logout() unconditionally on every HTTP 401, even when the user was already unauthenticated, causing an infinite logout→getSessionUser→401 loop. Fixed to only call logout() when a
user is actually authenticated; otherwise navigates to the login/share-login page directly.
assigned UserRoles.LimitedGuest. Changed the role check to LimitedGuest — the existing session projectionQuery already restricts sharing users to only see content within their shared directory, so there is no security
regression.
renders each folder at or below the share root as a clickable link, while folders above the share root remain plain text so users cannot navigate outside their share. The sharing key is preserved in all breadcrumb
links automatically.