From 43ae707ac4267afdf709d14867d12a1b5e443d77 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Fri, 24 May 2024 12:56:37 +0700 Subject: [PATCH] Add MaybeProtectedForm to optionally skip turnstile Using `` for this purpose caused a warning about an unknown `turnstileToken` property when the component was Form rather than ProtectedForm. To avoid this warning, we create a new component that selects between Form and ProtectedForm, and sends turnstileToken only to ProtectedForm. --- .../lib/components/Users/CreateUser.svelte | 6 +++--- .../src/lib/forms/MaybeProtectedForm.svelte | 19 +++++++++++++++++++ frontend/src/lib/forms/index.ts | 2 ++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 frontend/src/lib/forms/MaybeProtectedForm.svelte diff --git a/frontend/src/lib/components/Users/CreateUser.svelte b/frontend/src/lib/components/Users/CreateUser.svelte index 9009bc3e0..f07b89155 100644 --- a/frontend/src/lib/components/Users/CreateUser.svelte +++ b/frontend/src/lib/components/Users/CreateUser.svelte @@ -1,6 +1,6 @@ - +