You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clear and concise description of the feature you are proposing
Context / motivation
PUBLIC_VIEW_NOTE_PATH_PREFIX (added in #418) makes it much easier to expose a dedicated unauthenticated path for public note viewing when running Enclosed behind third-party auth (e.g., Authentik forward-auth). Also, the UI already has logic to conditionally display the “New Note” button based on authentication state (#379).
With Authentik-style setups, it’s common to:
Require auth for the main app (/)
Allow anonymous access to the public note view path (e.g., /${PUBLIC_VIEW_NOTE_PATH_PREFIX}/...)
Allow anonymous GET access to read note APIs (/api/notes/...), while keeping POST authenticated
A user comment in #408 describes a UX issue in this setup: when an anonymous user is viewing a public note, clicking “New note” navigates to the create-note UI without triggering the reverse-proxy authentication challenge (because it’s client-side navigation). The actual note creation later fails (as expected) because POST /api/notes is still protected.
Problem
When accessing Enclosed through a reverse proxy that enforces auth on /, a user who is currently on the public view route can click “New note” and get routed to / without a full document request, so the reverse proxy never gets a chance to challenge the request at navigation time. This results in confusing UX: the create page loads, but “Create note” fails later due to missing authentication.
Proposed change (small)
In app.layout.tsx, change the newNoteClicked handler to perform a hard navigation:
It doesn’t change server-side security boundaries (POST should still be protected); it only improves navigation UX and interoperability with reverse proxies.
What type of request is this?
Hosting or Self-hosting improvement
Clear and concise description of the feature you are proposing
Context / motivation
PUBLIC_VIEW_NOTE_PATH_PREFIX(added in #418) makes it much easier to expose a dedicated unauthenticated path for public note viewing when running Enclosed behind third-party auth (e.g., Authentik forward-auth). Also, the UI already has logic to conditionally display the “New Note” button based on authentication state (#379).With Authentik-style setups, it’s common to:
/)/${PUBLIC_VIEW_NOTE_PATH_PREFIX}/...)/api/notes/...), while keeping POST authenticatedA user comment in #408 describes a UX issue in this setup: when an anonymous user is viewing a public note, clicking “New note” navigates to the create-note UI without triggering the reverse-proxy authentication challenge (because it’s client-side navigation). The actual note creation later fails (as expected) because
POST /api/notesis still protected.Problem
When accessing Enclosed through a reverse proxy that enforces auth on
/, a user who is currently on the public view route can click “New note” and get routed to/without a full document request, so the reverse proxy never gets a chance to challenge the request at navigation time. This results in confusing UX: the create page loads, but “Create note” fails later due to missing authentication.Proposed change (small)
In
app.layout.tsx, change thenewNoteClickedhandler to perform a hard navigation:From
To
Expected behavior after change
When an anonymous user is on a public note view page and clicks “New note”:
/Notes / why this helps
Related
Additional context
No response
Validations