Some small portal fixes

This commit is contained in:
Dominic Ferrando
2026-07-03 20:05:20 -04:00
parent 13195dfd0a
commit 2ae4bbaf0c
2 changed files with 15 additions and 8 deletions
+14 -7
View File
@@ -13,15 +13,22 @@
const password = new FormData(form).get("password")?.toString() ?? "";
loading = true;
const { status } = await api.auth.login.post({ password });
loading = false;
try {
const { status } = await api.auth.login.post({ password });
if (status === 401) {
error = "Invalid password";
return;
if (status === 401) {
error = "Invalid password";
return;
}
await goto("/");
}
catch {
error = "Unable to reach the server. Please try again.";
}
finally {
loading = false;
}
await goto("/");
}
</script>