diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-07-08 00:59:11 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-07-08 01:02:15 -0400 |
| commit | 1286754681cf37a5a01a6a2fcef0fa4a99cc65a9 (patch) | |
| tree | 2cf5332116e978bca35b3476a1d2784fbf9f2b61 | |
| parent | dbc9d7fd264ed68419286d4edfc3b98ca5a2dbe0 (diff) | |
Set non-`undefined` initial values for the login form.
The default state of a `$state()` with no arguments is `undefined`, which was then leaking out of this component if the user clicks `sign in` without changing the values. Axiom, our HTTP client library, suppresses fields with `undefined` values in JSON payloads (sensibly enough), leading to empty requests.
| -rw-r--r-- | ui/lib/components/LogIn.svelte | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/lib/components/LogIn.svelte b/ui/lib/components/LogIn.svelte index c49ea3b..b491583 100644 --- a/ui/lib/components/LogIn.svelte +++ b/ui/lib/components/LogIn.svelte @@ -1,8 +1,8 @@ <script> let { legend = 'sign in', logIn = async (username, password) => {} } = $props(); - let username = $state(); - let password = $state(); + let username = $state(''); + let password = $state(''); let disabled = $state(false); async function onsubmit(event) { |
