aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(static)/login
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)/login
parent8388481901dfbb83db8955947841379b2b2c2675 (diff)
downloadcoinos-ui-99c159ae313dc6e791ae82cf937a0e29f110d97c.tar.gz
coinos-ui-99c159ae313dc6e791ae82cf937a0e29f110d97c.zip
skip captcha for tor
Diffstat (limited to 'src/routes/(static)/login')
-rw-r--r--src/routes/(static)/login/+page.svelte4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/routes/(static)/login/+page.svelte b/src/routes/(static)/login/+page.svelte
index adc4c804..bec702a1 100644
--- a/src/routes/(static)/login/+page.svelte
+++ b/src/routes/(static)/login/+page.svelte
@@ -39,6 +39,7 @@
let { challenge } = $derived(data);
let recaptchaSiteKey = PUBLIC_RECAPTCHA_SITE_KEY;
+ let isTor = $derived(browser && location.hostname.endsWith(".onion"));
let token = $state("");
let cancel = () => (need2fa = false);
@@ -57,6 +58,7 @@
const getRecaptchaToken = () =>
new Promise((resolve, reject) => {
+ if (isTor) return resolve("");
if (!browser || !grecaptcha) return reject(new Error("captcha unavailable"));
grecaptcha.ready(() => {
grecaptcha
@@ -151,11 +153,13 @@
});
</script>
+{#if !isTor}
<svelte:head
><script
src={"https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey}
></script></svelte:head
>
+{/if}
<div
class="mx-auto md:shadow-xl rounded-3xl max-w-xl w-full md:w-[480px] md:p-8 mb-20 space-y-5"