pediatric-ai-scribe-v3/docs
Daniel 82ed46d01b Fix Turnstile in the mobile app; drop it from login
The Turnstile challenge failed reliably inside the Capacitor WebView,
which blocked login and registration from the Android app.

Three separate causes:

1. Android WebView blocks third-party cookies by default. Turnstile runs
   in a cross-origin iframe from challenges.cloudflare.com and needs its
   own storage, so the widget never emitted a token. MainActivity now
   calls setAcceptThirdPartyCookies on the app's own WebView.

2. The register handler read the Turnstile response with an unscoped
   document.querySelector, which matched the *login* widget's input (it
   comes first in the DOM). Registration therefore submitted the login
   widget's token — single-use with a 5 minute expiry, so any prior login
   attempt or slow signup made it fail server-side.

3. The register and forgot-password widgets auto-rendered inside forms
   that start at display:none, where Turnstile does not reliably complete
   a challenge, and nothing re-rendered them when the form was shown.

Widgets are now rendered explicitly when their form first becomes
visible, and tokens are captured from the render callback instead of
being read back out of the injected input — which makes the unscoped
lookup in (2) structurally impossible. Added error/expired/timeout
callbacks so a widget failure surfaces the Cloudflare error code instead
of failing silently behind a generic toast.

Login is no longer gated at all. It is the path mobile users hit
constantly, and it is already covered by a 10-per-15-min per-IP rate
limit, a constant-time credential check, and TOTP 2FA. Registration and
password reset — the endpoints that actually attract bots — stay gated.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-30 17:22:03 +02:00
..
logic simplify speech and embeddings through litellm 2026-05-09 05:09:02 +02:00
ai-providers.md docs refresh current workflows 2026-05-09 00:40:45 +02:00
api-reference.md Fix Turnstile in the mobile app; drop it from login 2026-07-30 17:22:03 +02:00
ARCHITECTURE.md document architecture and harden rendering 2026-05-10 01:07:56 +02:00
architecture.md ci: route Android APK through Forgejo releases 2026-05-11 04:21:15 +02:00
authentication.md Fix Turnstile in the mobile app; drop it from login 2026-07-30 17:22:03 +02:00
CLINICAL_ASSISTANT.md document architecture and harden rendering 2026-05-10 01:07:56 +02:00
configuration.md simplify speech and embeddings through litellm 2026-05-09 05:09:02 +02:00
database.md docs align memory and audio backup behavior 2026-05-08 23:32:39 +02:00
deployment.md ci: route Android APK through Forgejo releases 2026-05-11 04:21:15 +02:00
developer-guide.md simplify speech and embeddings through litellm 2026-05-09 05:09:02 +02:00
DEVELOPMENT.md document architecture and harden rendering 2026-05-10 01:07:56 +02:00
embeddings-setup.md simplify speech and embeddings through litellm 2026-05-09 05:09:02 +02:00
features-explained.md simplify speech and embeddings through litellm 2026-05-09 05:09:02 +02:00
improvements.md docs refresh current workflows 2026-05-09 00:40:45 +02:00
learning-hub.md docs: rewrite architecture, authentication, configuration, deployment, ai-providers, speech, database, learning-hub, migrations, developer-guide for public audience 2026-04-15 00:26:38 +02:00
migrations.md docs: rewrite architecture, authentication, configuration, deployment, ai-providers, speech, database, learning-hub, migrations, developer-guide for public audience 2026-04-15 00:26:38 +02:00
mobile-build.md ci: route Android APK through Forgejo releases 2026-05-11 04:21:15 +02:00
MODULE_CONVENTIONS.md document architecture and harden rendering 2026-05-10 01:07:56 +02:00
openid-setup.md feat: ED multi-stage UX, extensions polish, docs viewer + application-logic docs 2026-04-28 03:09:38 +02:00
SCALING.md document architecture and harden rendering 2026-05-10 01:07:56 +02:00
speech.md simplify speech and embeddings through litellm 2026-05-09 05:09:02 +02:00
transcription-options.md simplify speech and embeddings through litellm 2026-05-09 05:09:02 +02:00