From f917cc4e8de297a22ac2b1d2b49ae81e31308f67 Mon Sep 17 00:00:00 2001 From: HithaHarish Date: Fri, 9 Jan 2026 00:15:18 +0530 Subject: [PATCH] fix: added frontend only redirection for forgot password --- front/src/app/login/page.tsx | 180 +++++++++++++++++++++++------------ package-lock.json | 6 ++ 2 files changed, 125 insertions(+), 61 deletions(-) create mode 100644 package-lock.json diff --git a/front/src/app/login/page.tsx b/front/src/app/login/page.tsx index 879ea3035..d31d1994a 100644 --- a/front/src/app/login/page.tsx +++ b/front/src/app/login/page.tsx @@ -106,6 +106,8 @@ export default function LoginPage() { const [password, setPassword] = useState(""); const [loading, setLoading] = useState(false); const [focusedInput, setFocusedInput] = useState(""); + const [showForgotPassword, setShowForgotPassword] = useState(false); + const handleLogin = async () => { try { @@ -232,76 +234,132 @@ export default function LoginPage() { >
setShowLogin(false)} + onClick={() => { + setShowLogin(false); + setShowForgotPassword(false); + }} + className="absolute top-4 right-4 p-2 rounded-full bg-slate-800/50 hover:bg-slate-700/50 transition-colors" > -

- Welcome Back -

-

- Sign in to continue -

- - {/* Email */} -
- -
- - setEmail(e.target.value)} - onKeyDown={handleKeyPress} - /> + {!showForgotPassword ? ( + <> +

+ Welcome Back +

+

+ Sign in to continue +

+ + {/* Email */} +
+ +
+ + setEmail(e.target.value)} + onKeyDown={handleKeyPress} + /> +
-
- - {/* Password */} -
- -
- - setPassword(e.target.value)} - onKeyDown={handleKeyPress} - /> + + {/* Password */} +
+ +
+ + setPassword(e.target.value)} + onKeyDown={handleKeyPress} + /> +
-
- {/* Login Button */} - - {loading ? ( - - - Signing in... - - ) : ( - "Sign In" - )} - + {/* Login Button */} + + {loading ? ( + + + Signing in... + + ) : ( + "Sign In" + )} + + +
+ + +
+ + ) : ( + <> + {/* ===== FORGOT PASSWORD UI (NEW) ===== */} + + + +

+ Forgot Password +

+ +

+ Enter your email and we’ll send reset instructions. +

+ +
+ + setEmail(e.target.value)} + /> +
-
- - Forgot your password? - -
+ + + )}
)} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..1800e58c3 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "Legal-Summarizer", + "lockfileVersion": 3, + "requires": true, + "packages": {} +}