aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(static)/login
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-01-27 09:47:26 -0800
committerAdam Soltys <[email protected]>2026-01-27 09:47:26 -0800
commitc28b2c4d44f2aeff4e84f2627d76d1138b473bd3 (patch)
treeb9a4b06481ef2b3c93b2be76b9e693a1787e8cde /src/routes/(static)/login
parent99c159ae313dc6e791ae82cf937a0e29f110d97c (diff)
downloadcoinos-ui-c28b2c4d44f2aeff4e84f2627d76d1138b473bd3.tar.gz
coinos-ui-c28b2c4d44f2aeff4e84f2627d76d1138b473bd3.zip
fix captcha checks
Diffstat (limited to 'src/routes/(static)/login')
-rw-r--r--src/routes/(static)/login/+page.svelte18
1 files changed, 9 insertions, 9 deletions
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 @@
});
</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"
>