aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(static)/register
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-01-27 09:41:25 -0800
committerAdam Soltys <[email protected]>2026-01-27 09:41:25 -0800
commit99c159ae313dc6e791ae82cf937a0e29f110d97c (patch)
treeaba99dd9eed65f35c109167f2274910bbc79f00a /src/routes/(static)/register
parent8388481901dfbb83db8955947841379b2b2c2675 (diff)
downloadcoinos-ui-99c159ae313dc6e791ae82cf937a0e29f110d97c.tar.gz
coinos-ui-99c159ae313dc6e791ae82cf937a0e29f110d97c.zip
skip captcha for tor
Diffstat (limited to 'src/routes/(static)/register')
-rw-r--r--src/routes/(static)/register/+page.svelte4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/routes/(static)/register/+page.svelte b/src/routes/(static)/register/+page.svelte
index f47bb3c1..cc3eb722 100644
--- a/src/routes/(static)/register/+page.svelte
+++ b/src/routes/(static)/register/+page.svelte
@@ -30,6 +30,7 @@
let { form, data } = $props();
let { challenge } = $derived(data);
let recaptchaSiteKey = PUBLIC_RECAPTCHA_SITE_KEY;
+ let isTor = $derived(browser && location.hostname.endsWith(".onion"));
onMount(() => {
if (browser) {
@@ -97,6 +98,7 @@
let loading = $state();
const getRecaptchaToken = () =>
new Promise((resolve, reject) => {
+ if (isTor) return resolve("");
if (!browser || !grecaptcha) return reject(new Error("captcha unavailable"));
grecaptcha.ready(() => {
grecaptcha
@@ -253,11 +255,13 @@
});
</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} />