diff --git a/AGENTS.md b/AGENTS.md index eb03692..86022e6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -97,15 +97,18 @@ not for the public pages. See `docs/design-principles.md` for the design. - `pagerite.js` — public page entry; runs fetch-navigation, scroll-reveal, brand shrink-to-fit (the themed size is the maximum; JS reduces the font-size so a long brand or narrow viewport still fits one line), - code copy buttons, and the auth check: it probes `GET /_api/settings` - and only then injects the 🖊️ edit pens (asset URLs from the - `pagerite:editor-src`/`-css` meta tags). The same reverse proxy that + code copy buttons, and the auth check. It first probes `GET /auth/api/settings` + to detect whether Paskia SSO is available, then `GET /_api/settings` to + learn the current session's admin status. The same reverse proxy that gates `/_api` returns 401 for anonymous users, 403 for users without - the admin permission, and 200 for admins; a 401 adds a "log in" link - to `/auth/` in the banner corner, a 403 nothing, and any other - result (no auth proxy, e.g. dev) leaves editing open. Pages themselves - render identically for everyone; the real gate is the auth proxy in - front of all of `/_api`. The backend links the shared CSS as two separate + the admin permission, and 200 for admins. When Paskia is detected, a + 🔑 login button (anonymous) or 👤 profile button (logged in) is shown in + the banner corner; both open Paskia's iframe dialog via `showAuthIframe` + instead of navigating away. Admins also get the 🖊️ edit pens (asset URLs + from the `pagerite:editor-src`/`-css` meta tags). If no Paskia SSO is + detected (dev/no proxy), editing is left open. Pages themselves render + identically for everyone; the real gate is the auth proxy in front of + all of `/_api`. The backend links the shared CSS as two separate stylesheets (base and theme) so they can be swapped or augmented. - `assets/` — shared styles and data files built by Vite and served hashed under `/_assets/`: `pagerite.css` (base layout + conservative variables), diff --git a/frontend/package.json b/frontend/package.json index 3d44584..6a169e6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -18,6 +18,7 @@ "@codemirror/view": "^6.43.8", "@lezer/highlight": "^1.2.3", "codemirror": "^6.0.2", + "paskia": "file:../../paskia/paskia-js", "transliteration": "^2.6.1", "vue": "^3.5.26", "vuedraggable": "^4.1.0" diff --git a/frontend/src/StructureTree.vue b/frontend/src/StructureTree.vue index 467196d..c4f2df9 100644 --- a/frontend/src/StructureTree.vue +++ b/frontend/src/StructureTree.vue @@ -142,6 +142,7 @@ function onEnd() { draft