From ce66fe13e8718b8abbf67adca9fa1775c932401f Mon Sep 17 00:00:00 2001 From: whoswhip Date: Wed, 7 Jan 2026 10:23:40 -0500 Subject: [PATCH] fix: improve error handling and display for login failures --- SharpbinV3.Client/src/routes/login/+page.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/SharpbinV3.Client/src/routes/login/+page.svelte b/SharpbinV3.Client/src/routes/login/+page.svelte index 0b5a785..fb8430e 100644 --- a/SharpbinV3.Client/src/routes/login/+page.svelte +++ b/SharpbinV3.Client/src/routes/login/+page.svelte @@ -62,7 +62,13 @@ } window.location.href = '/'; } else { - error = 'Invalid username or password'; + const resData = await res.json(); + if (resData.errors) { + const messages = Object.values(resData.errors).flat(); + error = messages.join('\n'); + } else { + error = resData.message || 'Login failed. Please try again.'; + } } } @@ -101,7 +107,9 @@ Login {#if error} -
+
{error}
{/if}