From c28b2c4d44f2aeff4e84f2627d76d1138b473bd3 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 27 Jan 2026 09:47:26 -0800 Subject: fix captcha checks --- src/routes/(app)/reset/[code]/+page.svelte | 20 ++++++++++---------- src/routes/(static)/login/+page.svelte | 18 +++++++++--------- src/routes/(static)/register/+page.svelte | 18 +++++++++--------- src/routes/(static)/support/+page.svelte | 20 ++++++++++---------- 4 files changed, 38 insertions(+), 38 deletions(-) (limited to 'src') diff --git a/src/routes/(app)/reset/[code]/+page.svelte b/src/routes/(app)/reset/[code]/+page.svelte index 755b7d19..ce43a79d 100644 --- a/src/routes/(app)/reset/[code]/+page.svelte +++ b/src/routes/(app)/reset/[code]/+page.svelte @@ -1,7 +1,7 @@ -{#if !isTor} - -{/if} -
diff --git a/src/routes/(static)/login/+page.svelte b/src/routes/(static)/login/+page.svelte index bec702a1..04044060 100644 --- a/src/routes/(static)/login/+page.svelte +++ b/src/routes/(static)/login/+page.svelte @@ -39,9 +39,17 @@ let { challenge } = $derived(data); let recaptchaSiteKey = PUBLIC_RECAPTCHA_SITE_KEY; - let isTor = $derived(browser && location.hostname.endsWith(".onion")); + let isTor = browser && location.hostname.endsWith(".onion"); let token = $state(""); + onMount(() => { + if (!isTor && recaptchaSiteKey) { + let s = document.createElement("script"); + s.src = "https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey; + document.head.appendChild(s); + } + }); + let cancel = () => (need2fa = false); let username = $state(), @@ -153,14 +161,6 @@ }); -{#if !isTor} - -{/if} -
diff --git a/src/routes/(static)/register/+page.svelte b/src/routes/(static)/register/+page.svelte index cc3eb722..bb3af128 100644 --- a/src/routes/(static)/register/+page.svelte +++ b/src/routes/(static)/register/+page.svelte @@ -30,7 +30,15 @@ let { form, data } = $props(); let { challenge } = $derived(data); let recaptchaSiteKey = PUBLIC_RECAPTCHA_SITE_KEY; - let isTor = $derived(browser && location.hostname.endsWith(".onion")); + let isTor = browser && location.hostname.endsWith(".onion"); + + onMount(() => { + if (!isTor && recaptchaSiteKey) { + let s = document.createElement("script"); + s.src = "https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey; + document.head.appendChild(s); + } + }); onMount(() => { if (browser) { @@ -255,14 +263,6 @@ }); -{#if !isTor} - -{/if} - {#if need2fa} {/if} diff --git a/src/routes/(static)/support/+page.svelte b/src/routes/(static)/support/+page.svelte index 620ed018..4cf9706d 100644 --- a/src/routes/(static)/support/+page.svelte +++ b/src/routes/(static)/support/+page.svelte @@ -1,7 +1,7 @@ -{#if !isTor} - -{/if} -
{#if sent}

Thank you!

-- cgit v1.2.3