From fadf09bf4a0183225ffd084d6708b254e24d11e3 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 11 Sep 2026 05:09:02 +0200 Subject: [PATCH] revert: remove the signed-out assistant preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed at the owner's request, entirely rather than switched off: the route's allow-list, anonymous identity and flag lookup; the client's entry path, the authFetch exception that let four endpoints out without an account, and the workspace guard; the CSS, the in-page note, the admin flag and its save/load; the test file and the assertions elsewhere that pinned it. Both settings rows are deleted from app_settings. Two things were checked rather than assumed on the way out. Removing the anonymous identity collapsed every `if (!req.user.preview)` branch to its authenticated side, so image tools, audit logging and citation storage now run unconditionally — which is what they did before preview existed. And the route's gate went back to a bare router.use(authMiddleware), which on a /api mount gates every path below it in server.js; it is scoped to /clinical-assistant again, the guard test catches it either way. Verified after deploy: signed out, status, examples and chat all refuse with 401; signed in, chat still answers with 8 sources; extensions, encounters, documents and admin remain shut. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU --- public/components/admin.html | 8 -- public/components/assistant.html | 1 - public/css/styles.css | 9 -- public/js/admin.js | 13 +-- public/js/app.js | 7 -- public/js/auth.js | 32 +------ public/js/authFetch.js | 20 ---- src/routes/clinicalAssistant.js | 82 +++------------- test/assistant-preview.test.js | 119 ------------------------ test/assistant-workspace-layout.test.js | 3 - test/backend-hardening.test.js | 2 +- test/policy-flows.test.js | 16 ---- 12 files changed, 15 insertions(+), 297 deletions(-) delete mode 100644 test/assistant-preview.test.js diff --git a/public/components/admin.html b/public/components/admin.html index d44c8906..7f2996bb 100644 --- a/public/components/admin.html +++ b/public/components/admin.html @@ -119,14 +119,6 @@ -
- - -
-

Lets a visitor who is not signed in try the Clinical Assistant. They can ask questions and read the answer; everything else asks them to sign in. Nothing is saved to any account, because a preview visitor has no account.

diff --git a/public/components/assistant.html b/public/components/assistant.html index 611d3340..28c9a91c 100644 --- a/public/components/assistant.html +++ b/public/components/assistant.html @@ -2,7 +2,6 @@