diff options
Diffstat (limited to 'frontend/src/pages')
| -rw-r--r-- | frontend/src/pages/Login.tsx | 17 |
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 ( |
