diff --git a/src/app/ChangePassword/page.tsx b/src/app/ChangePassword/page.tsx index 1797470..5b044c9 100644 --- a/src/app/ChangePassword/page.tsx +++ b/src/app/ChangePassword/page.tsx @@ -94,6 +94,8 @@ export default function Login() { placeholder="Enter your password" required id="loginPassword" + value={password} + onChange={(e) => setPassword(e.currentTarget.value)} onCopy={(e) => e.preventDefault()} onPaste={(e) => e.preventDefault()} onCut={(e) => e.preventDefault()} @@ -157,6 +159,8 @@ export default function Login() { else { // If all checks pass + localStorage.setItem("password",password); + localStorage.setItem("Tpin_setup","Y"); router.push("/ChangeTxn"); notifications.show({ title: 'Password Change', diff --git a/src/app/ChangeTxn/page.tsx b/src/app/ChangeTxn/page.tsx index 5bb847e..b775033 100644 --- a/src/app/ChangeTxn/page.tsx +++ b/src/app/ChangeTxn/page.tsx @@ -27,10 +27,7 @@ export default function Login() { const [captchaInput, setCaptchaInput] = useState(''); const [captchaError, setCaptchaError] = useState(''); // const [isClient,SetIsClient] =useState(false); - - // useEffect(()=> SetIsClient(true),[]); - // useEffect(() => { // setCaptcha(generateCaptcha()); // }, []); @@ -162,7 +159,7 @@ export default function Login() { align="center" mb="md">Change Transaction Password
e.preventDefault()} /> import('./clientCarousel'), { ssr: false }); - + localStorage.setItem("password", "SecurePass123!"); + localStorage.setItem("Tpin_setup", "F"); + useEffect(() => { setCaptcha(generateCaptcha()); }, []); @@ -53,17 +55,24 @@ export default function Login() { return; } - if (CIF === "30022497139" && psw === "SecurePass123!") { + if (CIF === "30022497139" && psw === localStorage.getItem("password")) { const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30"; - localStorage.setItem("customerNumber", CIF); - localStorage.setItem("password", psw); + // localStorage.setItem("customerNumber", CIF); + // localStorage.setItem("password", psw); + // console.log("Tithi:", localStorage.getItem("password")); + console.log("Tithi:", localStorage.getItem("Tpin_setup")); localStorage.setItem("access_token", token); setIsLogging(true); + // if (localStorage.getItem("Tpin_setup") === 'F') + // router.push("/ChangePassword"); + // else router.push("/home"); } else { // SetCIF(''); // SetPsw(''); // setCaptcha(''); + console.log("Tithi:", localStorage.getItem("password")); + console.log("Tithi:", localStorage.getItem("Tpin_setup")); notifications.show({ withBorder: true, color: "red", @@ -135,7 +144,7 @@ export default function Login() { `} -
+
-
- - - - <Text fs="italic">Welcome To KCC Bank</Text> - <Text fw={700} style={{ fontSize: "18px", color: "#000066" }}>Internet Banking</Text> - - - - - { - const input = e.currentTarget.value.replace(/\D/g, ""); - if (input.length <= 11) { - SetCIF(input); - } - }} - required - error={error} - /> + > */} + SetPsw(e.currentTarget.value)} - required - /> - - - {captcha} - - - - setInputCaptcha(e.currentTarget.value)} - required - /> - - - - - - -
+ + setInputCaptcha(e.currentTarget.value)} + required + /> + + + + + + + {/*
*/}