diff options
| author | Adam Soltys <[email protected]> | 2026-01-27 09:47:26 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-01-27 09:47:26 -0800 |
| commit | c28b2c4d44f2aeff4e84f2627d76d1138b473bd3 (patch) | |
| tree | b9a4b06481ef2b3c93b2be76b9e693a1787e8cde /src/routes/(static)/register | |
| parent | 99c159ae313dc6e791ae82cf937a0e29f110d97c (diff) | |
| download | coinos-ui-c28b2c4d44f2aeff4e84f2627d76d1138b473bd3.tar.gz coinos-ui-c28b2c4d44f2aeff4e84f2627d76d1138b473bd3.zip | |
fix captcha checks
Diffstat (limited to 'src/routes/(static)/register')
| -rw-r--r-- | src/routes/(static)/register/+page.svelte | 18 |
1 files changed, 9 insertions, 9 deletions
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 @@ }); </script> -{#if !isTor} -<svelte:head - ><script - src={"https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey} - ></script></svelte:head -> -{/if} - {#if need2fa} <Pin bind:value={token} title="Enter 2FA Code" {cancel} notify={false} /> {/if} |
