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/(static)/login/+page.svelte | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/routes/(static)/login') 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} -
-- cgit v1.2.3