diff options
Diffstat (limited to 'src/routes/(app)')
| -rw-r--r-- | src/routes/(app)/reset/[code]/+page.svelte | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/routes/(app)/reset/[code]/+page.svelte b/src/routes/(app)/reset/[code]/+page.svelte index 755b7d19..ce43a79d 100644 --- a/src/routes/(app)/reset/[code]/+page.svelte +++ b/src/routes/(app)/reset/[code]/+page.svelte @@ -1,7 +1,7 @@ <script> import { PUBLIC_RECAPTCHA_SITE_KEY } from "$env/static/public"; import { browser } from "$app/environment"; - import { onDestroy, tick } from "svelte"; + import { onDestroy, onMount, tick } from "svelte"; import { t } from "$lib/translations"; import PasswordInput from "$comp/PasswordInput.svelte"; import Icon from "$comp/Icon.svelte"; @@ -15,7 +15,15 @@ let loading; let recaptchaToken = ""; 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); + } + }); const getRecaptchaToken = () => new Promise((resolve, reject) => { @@ -60,14 +68,6 @@ }); </script> -{#if !isTor} -<svelte:head - ><script - src={"https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey} - ></script></svelte:head -> -{/if} - <div class="pt-10"> <div class="w-[243px] mx-auto mb-10"> <a href="/"> |
