aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/pages
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-11-08 16:09:01 +0900
committernsfisis <nsfisis@gmail.com>2025-11-08 16:09:37 +0900
commit2c81ffffaaee816f271b1bfe488e64d0288050fc (patch)
tree47c560c5d88bd16b3cec410bb53df17cd2cad363 /frontend/src/pages
parent603419f4b43d0c36e3f6bbaf9f4ffc20f316a8aa (diff)
downloadfeedaka-2c81ffffaaee816f271b1bfe488e64d0288050fc.tar.gz
feedaka-2c81ffffaaee816f271b1bfe488e64d0288050fc.tar.zst
feedaka-2c81ffffaaee816f271b1bfe488e64d0288050fc.zip
fix(frontend): Don't discard GraphQL error
Diffstat (limited to 'frontend/src/pages')
-rw-r--r--frontend/src/pages/Login.tsx17
1 files changed, 6 insertions, 11 deletions
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 (