From 2c81ffffaaee816f271b1bfe488e64d0288050fc Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sat, 8 Nov 2025 16:09:01 +0900
Subject: fix(frontend): Don't discard GraphQL error

---
 frontend/src/pages/Login.tsx | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

(limited to 'frontend/src/pages/Login.tsx')

diff --git a/frontend/src/pages/Login.tsx b/frontend/src/pages/Login.tsx
index 5703047..277488e 100644
--- a/frontend/src/pages/Login.tsx
+++ b/frontend/src/pages/Login.tsx
@@ -15,18 +15,13 @@ export function Login() {
 		setError("");
 		setIsLoading(true);
 
-		try {
-			const success = await login(username, password);
-			if (success) {
-				setLocation("/");
-			} else {
-				setError("Invalid username or password");
-			}
-		} catch (_err) {
-			setError("An error occurred during login");
-		} finally {
-			setIsLoading(false);
+		const result = await login(username, password);
+		if (result.success) {
+			setLocation("/");
+		} else {
+			setError(result.error);
 		}
+		setIsLoading(false);
 	};
 
 	return (
-- 
cgit v1.2.3-70-g09d2

