pediatric-ai-scribe-v3/public
Daniel f12bdb0fa4 Fix: revoked sessions now actually log the other device out
The server-side revoke was always working — it deletes user_sessions
rows, and middleware correctly returned 401 on the revoked device's
next /api/* request. The bug was entirely client-side: individual
fetch handlers swallowed the 401 (rendering "no sessions found" or
empty data) and nothing redirected to the login screen. So the
revoked device looked like it stayed signed in.

Added public/js/authFetch.js: a global fetch interceptor that
watches every /api/* response. On 401 from a non-auth endpoint
(i.e. not /login, /register, /logout, /me, etc.), it clears any
cached token/user state and reloads the page. The reload's boot
flow lands on /api/auth/me → 401 → login screen as usual.

Guarded against false positives: only triggers when the app believes
the user is currently logged in (AUTH_TOKEN set or main-app visible)
so a pre-login 401 doesn't accidentally flash the screen.

Loaded before auth.js in index.html.
2026-04-14 05:10:16 +02:00
..
.well-known Add SHA256 fingerprint to assetlinks.json for TWA domain verification 2026-03-29 00:32:58 +00:00
components Hide Active Sessions for SSO-only users 2026-04-14 05:07:07 +02:00
css Add automatic ICD-10 and CPT billing code suggestions 2026-04-11 01:50:17 +02:00
icons Feat: add stethoscope+pencil favicon in SVG, ICO, and PNG sizes 2026-03-22 14:09:18 -04:00
js Fix: revoked sessions now actually log the other device out 2026-04-14 05:10:16 +02:00
vendor Replace Quill with Tiptap rich text editor 2026-03-23 23:32:41 -04:00
404.html Add proper 404 handling and custom error page 2026-03-23 23:47:50 -04:00
favicon.ico Feat: add stethoscope+pencil favicon in SVG, ICO, and PNG sizes 2026-03-22 14:09:18 -04:00
index.html Fix: revoked sessions now actually log the other device out 2026-04-14 05:10:16 +02:00
manifest.json v9: Major feature update — audio backup, SOAP save, Dragon memory, S3 docs, CI/CD, APK 2026-03-28 21:08:32 +00:00
sw.js Fix: bump SW cache to v12, switch JS/CSS to network-first 2026-03-29 20:02:34 -04:00