summaryrefslogtreecommitdiff
path: root/ui/routes/(app)/me/+page.svelte
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-30 18:01:48 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-30 18:01:48 -0400
commit1eec6338e1146439b1dbc6207843fbc44dd13088 (patch)
treecfa42de569384f2ea09002450df08b766f57506c /ui/routes/(app)/me/+page.svelte
parent73f58f2c648a48019c611a4659d882223e4432d4 (diff)
Don't leave field binding vars uninitialized.
This was causing problems for changing passwords: if the user didn't type anything in the "original password" field, the code path to sending that field to the server was just straight-up omitting the field from the message, rather than setting it to empty string, causing a 422 Unprocessable Entity. On investigation we had latent bugs related to this in a bunch of spots.
Diffstat (limited to 'ui/routes/(app)/me/+page.svelte')
-rw-r--r--ui/routes/(app)/me/+page.svelte2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/routes/(app)/me/+page.svelte b/ui/routes/(app)/me/+page.svelte
index 7559dbe..82af3c7 100644
--- a/ui/routes/(app)/me/+page.svelte
+++ b/ui/routes/(app)/me/+page.svelte
@@ -3,7 +3,7 @@
import Invites from '$lib/components/Invites.svelte';
- let currentPassword, newPassword, confirmPassword, passwordForm;
+ let currentPassword = "", newPassword = "", confirmPassword = "", passwordForm;
let pending = false;
$: valid = (newPassword === confirmPassword) && (newPassword !== currentPassword);
$: disabled = pending || !valid;