From 5a630d2a715acc851add8f82b19dba111d98c2bd Mon Sep 17 00:00:00 2001 From: whoswhip Date: Thu, 8 Jan 2026 15:38:50 -0500 Subject: [PATCH] fix: reset Turnstile on login and registration error handling --- SharpbinV3.Client/src/routes/+page.svelte | 2 +- SharpbinV3.Client/src/routes/login/+page.svelte | 3 +++ SharpbinV3.Client/src/routes/register/+page.svelte | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/SharpbinV3.Client/src/routes/+page.svelte b/SharpbinV3.Client/src/routes/+page.svelte index 0e71acc..2850e3c 100644 --- a/SharpbinV3.Client/src/routes/+page.svelte +++ b/SharpbinV3.Client/src/routes/+page.svelte @@ -252,7 +252,7 @@ {/if} {#if data.options?.requiresVerification && data.auth?.cf_turnstile_site_key}
diff --git a/SharpbinV3.Client/src/routes/login/+page.svelte b/SharpbinV3.Client/src/routes/login/+page.svelte index 9c110d1..30c21bc 100644 --- a/SharpbinV3.Client/src/routes/login/+page.svelte +++ b/SharpbinV3.Client/src/routes/login/+page.svelte @@ -73,6 +73,9 @@ const messages = Object.values(resData.errors).flat(); error = messages.join('\n'); } else { + if (window.turnstile) { + window.turnstile.reset(); + } if (resData.message === 'TOTP code is required.') { totpEnabled = true; } diff --git a/SharpbinV3.Client/src/routes/register/+page.svelte b/SharpbinV3.Client/src/routes/register/+page.svelte index 97d7aea..826c940 100644 --- a/SharpbinV3.Client/src/routes/register/+page.svelte +++ b/SharpbinV3.Client/src/routes/register/+page.svelte @@ -96,6 +96,9 @@ } } else { const resData = await res.json(); + if (window.turnstile) { + window.turnstile.reset(); + } if (resData.errors) { const messages = Object.values(resData.errors).flat(); error = messages.join('\n');