From de864671fb1c97137ac9240c1311de4b9d63bc2d Mon Sep 17 00:00:00 2001
From: schererleander <leander@schererleander.de>
Date: Fri, 26 Dec 2025 15:59:52 +0100
Subject: fix(login): improve error handling and redirect logic

---
 src/app/login/page.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/app/login/page.tsx')

diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx
index 9be16e7..ae89e63 100644
--- a/src/app/login/page.tsx
+++ b/src/app/login/page.tsx
@@ -43,9 +43,11 @@ export default function SignInPage() {
 
       if (result?.error) {
         setError("Invalid email or password")
-      } else {
+      } else if (result?.ok) {
         router.push("/")
         router.refresh()
+      } else {
+        setError("Something went wrong. Please try again.")
       }
     } catch {
       setError("An unexpected error occurred")
-- 
cgit v1.3.1

