summaryrefslogtreecommitdiff
path: root/ui/lib
diff options
context:
space:
mode:
authorojacobson <ojacobson@noreply.codeberg.org>2025-07-09 01:21:01 +0200
committerojacobson <ojacobson@noreply.codeberg.org>2025-07-09 01:21:01 +0200
commit948ecc916050a68c2e2ae7f0ddbc56a90db4785f (patch)
treef302b9b489a54a860e67084ac0116bfbd888a245 /ui/lib
parent4eb0cc56696a3805538e5ce6d380ea26e097424c (diff)
parent1286754681cf37a5a01a6a2fcef0fa4a99cc65a9 (diff)
Stop sending `{}` to the `/api/auth/login` endpoint when the login form hasn't been touched.
Steps to reproduce: **Note**: You will need to watch the traffic in a DOM inspector; this has no user-observable symptoms because there's presently no error reporting for the login form. 1. In a new private tab, visit the `/login` page of a Pilcrow instance. 2. **Without touching the username or password fields**, click `sign in`. The client _should_ send a request to `/api/auth/login` with the following payload: ```json { "name": "", "password": "" } ``` However, it instead sends an empty payload, leading to a 422 Unprocessable Content response as the request is missing required fields. Subsequent requests, or any request after the user enters data in the input fields, are correctly serialized. Merges login-form-nulls into main.
Diffstat (limited to 'ui/lib')
-rw-r--r--ui/lib/components/LogIn.svelte4
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) {