fix: change in password page
This commit is contained in:
@@ -94,6 +94,8 @@ export default function Login() {
|
|||||||
placeholder="Enter your password"
|
placeholder="Enter your password"
|
||||||
required
|
required
|
||||||
id="loginPassword"
|
id="loginPassword"
|
||||||
|
value={password}
|
||||||
|
onChange={(e) => setPassword(e.currentTarget.value)}
|
||||||
onCopy={(e) => e.preventDefault()}
|
onCopy={(e) => e.preventDefault()}
|
||||||
onPaste={(e) => e.preventDefault()}
|
onPaste={(e) => e.preventDefault()}
|
||||||
onCut={(e) => e.preventDefault()}
|
onCut={(e) => e.preventDefault()}
|
||||||
@@ -157,6 +159,8 @@ export default function Login() {
|
|||||||
|
|
||||||
else {
|
else {
|
||||||
// If all checks pass
|
// If all checks pass
|
||||||
|
localStorage.setItem("password",password);
|
||||||
|
localStorage.setItem("Tpin_setup","Y");
|
||||||
router.push("/ChangeTxn");
|
router.push("/ChangeTxn");
|
||||||
notifications.show({
|
notifications.show({
|
||||||
title: 'Password Change',
|
title: 'Password Change',
|
||||||
|
@@ -27,10 +27,7 @@ export default function Login() {
|
|||||||
const [captchaInput, setCaptchaInput] = useState('');
|
const [captchaInput, setCaptchaInput] = useState('');
|
||||||
const [captchaError, setCaptchaError] = useState('');
|
const [captchaError, setCaptchaError] = useState('');
|
||||||
// const [isClient,SetIsClient] =useState(false);
|
// const [isClient,SetIsClient] =useState(false);
|
||||||
|
|
||||||
|
|
||||||
// useEffect(()=> SetIsClient(true),[]);
|
// useEffect(()=> SetIsClient(true),[]);
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// setCaptcha(generateCaptcha());
|
// setCaptcha(generateCaptcha());
|
||||||
// }, []);
|
// }, []);
|
||||||
@@ -162,7 +159,7 @@ export default function Login() {
|
|||||||
align="center" mb="md">Change Transaction Password</Title>
|
align="center" mb="md">Change Transaction Password</Title>
|
||||||
<form>
|
<form>
|
||||||
<PasswordInput
|
<PasswordInput
|
||||||
label="Login Password"
|
label="Transaction Password"
|
||||||
placeholder="Enter your password"
|
placeholder="Enter your password"
|
||||||
required
|
required
|
||||||
id="loginPassword"
|
id="loginPassword"
|
||||||
@@ -171,7 +168,7 @@ export default function Login() {
|
|||||||
onCut={(e) => e.preventDefault()}
|
onCut={(e) => e.preventDefault()}
|
||||||
/>
|
/>
|
||||||
<PasswordInput
|
<PasswordInput
|
||||||
label="Confirm Login Password"
|
label="Confirm Transaction Password"
|
||||||
placeholder="Enter your password"
|
placeholder="Enter your password"
|
||||||
required
|
required
|
||||||
id="confirmPassword"
|
id="confirmPassword"
|
||||||
|
@@ -24,6 +24,8 @@ export default function Login() {
|
|||||||
const [inputCaptcha, setInputCaptcha] = useState("");
|
const [inputCaptcha, setInputCaptcha] = useState("");
|
||||||
const [isLogging, setIsLogging] = useState(false);
|
const [isLogging, setIsLogging] = useState(false);
|
||||||
const ClientCarousel = dynamic(() => import('./clientCarousel'), { ssr: false });
|
const ClientCarousel = dynamic(() => import('./clientCarousel'), { ssr: false });
|
||||||
|
localStorage.setItem("password", "SecurePass123!");
|
||||||
|
localStorage.setItem("Tpin_setup", "F");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCaptcha(generateCaptcha());
|
setCaptcha(generateCaptcha());
|
||||||
@@ -53,17 +55,24 @@ export default function Login() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CIF === "30022497139" && psw === "SecurePass123!") {
|
if (CIF === "30022497139" && psw === localStorage.getItem("password")) {
|
||||||
const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30";
|
const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30";
|
||||||
localStorage.setItem("customerNumber", CIF);
|
// localStorage.setItem("customerNumber", CIF);
|
||||||
localStorage.setItem("password", psw);
|
// localStorage.setItem("password", psw);
|
||||||
|
// console.log("Tithi:", localStorage.getItem("password"));
|
||||||
|
console.log("Tithi:", localStorage.getItem("Tpin_setup"));
|
||||||
localStorage.setItem("access_token", token);
|
localStorage.setItem("access_token", token);
|
||||||
setIsLogging(true);
|
setIsLogging(true);
|
||||||
|
// if (localStorage.getItem("Tpin_setup") === 'F')
|
||||||
|
// router.push("/ChangePassword");
|
||||||
|
// else
|
||||||
router.push("/home");
|
router.push("/home");
|
||||||
} else {
|
} else {
|
||||||
// SetCIF('');
|
// SetCIF('');
|
||||||
// SetPsw('');
|
// SetPsw('');
|
||||||
// setCaptcha('');
|
// setCaptcha('');
|
||||||
|
console.log("Tithi:", localStorage.getItem("password"));
|
||||||
|
console.log("Tithi:", localStorage.getItem("Tpin_setup"));
|
||||||
notifications.show({
|
notifications.show({
|
||||||
withBorder: true,
|
withBorder: true,
|
||||||
color: "red",
|
color: "red",
|
||||||
@@ -135,7 +144,7 @@ export default function Login() {
|
|||||||
`}
|
`}
|
||||||
</style>
|
</style>
|
||||||
</Box>
|
</Box>
|
||||||
<div style={{ display: "flex", height: "70vh", overflow: "hidden", position: "relative" }}>
|
<div style={{ display: "flex", height: "75vh", overflow: "hidden", position: "relative" }}>
|
||||||
<div style={{ flex: 1, backgroundColor: "#c1e0f0", position: "relative" }}>
|
<div style={{ flex: 1, backgroundColor: "#c1e0f0", position: "relative" }}>
|
||||||
<Image
|
<Image
|
||||||
fit="cover"
|
fit="cover"
|
||||||
@@ -145,7 +154,7 @@ export default function Login() {
|
|||||||
style={{ width: "100%", height: "100%" }}
|
style={{ width: "100%", height: "100%" }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
{/* <div
|
||||||
style={{
|
style={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: "#c1e0f0",
|
backgroundColor: "#c1e0f0",
|
||||||
@@ -154,97 +163,108 @@ export default function Login() {
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
height: "100%"
|
height: "100%"
|
||||||
}}
|
}}
|
||||||
>
|
> */}
|
||||||
<Card
|
<Card
|
||||||
shadow="lg"
|
shadow="lg"
|
||||||
padding="xl"
|
padding="xl"
|
||||||
radius="md"
|
radius="md"
|
||||||
style={{
|
style={{
|
||||||
width: "100%",
|
flex: 1,
|
||||||
maxWidth: 480,
|
display: "flex",
|
||||||
height: 380,
|
justifyContent: "center",
|
||||||
marginTop: 0,
|
alignItems: "center",
|
||||||
paddingTop: 5,
|
|
||||||
backgroundColor: "#f0f0f0",
|
|
||||||
borderRadius: "12px",
|
|
||||||
boxShadow: "0 2px 10px rgba(228, 215, 215, 0.1)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Stack gap="xs">
|
|
||||||
<Title order={6} style={{ marginLeft: 10 }}>
|
|
||||||
<Text fs="italic">Welcome To KCC Bank</Text>
|
|
||||||
<Text fw={700} style={{ fontSize: "18px", color: "#000066" }}>Internet Banking</Text>
|
|
||||||
</Title>
|
|
||||||
<Box
|
|
||||||
style={{
|
|
||||||
width: 370,
|
|
||||||
marginTop: 0,
|
|
||||||
paddingTop: 5,
|
|
||||||
padding: "10px",
|
|
||||||
border: "1px solid #e0e0d1",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Flex justify="center" gap="md">
|
|
||||||
<form onSubmit={handleLogin}>
|
|
||||||
<TextInput
|
|
||||||
size="xs"
|
|
||||||
label="User ID"
|
|
||||||
placeholder="Enter your CIF no"
|
|
||||||
type="text"
|
|
||||||
inputMode="numeric"
|
|
||||||
value={CIF}
|
|
||||||
onInput={(e) => {
|
|
||||||
const input = e.currentTarget.value.replace(/\D/g, "");
|
|
||||||
if (input.length <= 11) {
|
|
||||||
SetCIF(input);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
required
|
|
||||||
error={error}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<PasswordInput
|
// width: "400%",
|
||||||
label="Password"
|
// maxWidth: 480,
|
||||||
size="xs"
|
// height: 400,
|
||||||
placeholder="Enter your password"
|
// marginTop: 0,
|
||||||
value={psw}
|
// paddingTop: 5,
|
||||||
onChange={(e) => SetPsw(e.currentTarget.value)}
|
backgroundColor: "#f0f0f0",
|
||||||
required
|
borderRadius: 0,
|
||||||
/>
|
height: "100%",
|
||||||
<Group >
|
boxShadow: "0 2px 10px rgba(228, 215, 215, 0.1)",
|
||||||
<Box
|
// border:"1px solid black"
|
||||||
style={{
|
}}
|
||||||
padding: "5px 5px",
|
>
|
||||||
backgroundColor: "#ffffff",
|
<Stack gap="xs" style={{ width: "100%", maxWidth: 480, marginTop: 0 }}>
|
||||||
fontFamily: "'UnifrakturCook',cursive",
|
<Title order={6} style={{ marginLeft: 10, marginBottom: "8px" }}>
|
||||||
textDecoration: "line-through",
|
<Text fs="italic">Welcome To KCC Bank</Text>
|
||||||
userSelect: "none",
|
<Text fw={700} style={{ fontSize: "18px", color: "#000066" }}>Internet Banking</Text>
|
||||||
}}
|
</Title>
|
||||||
>
|
<Box
|
||||||
{captcha}
|
style={{
|
||||||
</Box>
|
// width: 370,
|
||||||
<Button variant="outline" size="xs" onClick={regenerateCaptcha}>
|
marginTop: 0,
|
||||||
Refresh
|
// paddingTop: 5,
|
||||||
</Button>
|
padding: "10px",
|
||||||
</Group>
|
border: "1px solid #e0e0d1",
|
||||||
<TextInput
|
}}
|
||||||
label="Enter CAPTCHA"
|
>
|
||||||
size="xs"
|
<Flex justify="center" gap="md">
|
||||||
placeholder="Enter above text"
|
<form onSubmit={handleLogin}>
|
||||||
value={inputCaptcha}
|
<TextInput
|
||||||
onChange={(e) => setInputCaptcha(e.currentTarget.value)}
|
size="md"
|
||||||
required
|
label="User ID"
|
||||||
/>
|
placeholder="Enter your CIF No"
|
||||||
<Button type="submit" disabled={isLogging} fullWidth variant="filled" mt="md">
|
type="text"
|
||||||
{/* Login */}
|
inputMode="numeric"
|
||||||
{isLogging ? "Logging.." :"Login"}
|
value={CIF}
|
||||||
|
onInput={(e) => {
|
||||||
|
const input = e.currentTarget.value.replace(/\D/g, "");
|
||||||
|
if (input.length <= 11) {
|
||||||
|
SetCIF(input);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
required
|
||||||
|
error={error}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<PasswordInput
|
||||||
|
label="Password"
|
||||||
|
size="md"
|
||||||
|
placeholder="Enter your password"
|
||||||
|
value={psw}
|
||||||
|
onChange={(e) => SetPsw(e.currentTarget.value)}
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<Group mt="xs" align="center" gap="xs" >
|
||||||
|
<Box
|
||||||
|
style={{
|
||||||
|
// padding: "5px",
|
||||||
|
alignItems: "center",
|
||||||
|
backgroundColor: "#fff",
|
||||||
|
fontFamily: "'UnifrakturCook',cursive",
|
||||||
|
textDecoration: "line-through",
|
||||||
|
fontSize: "16px",
|
||||||
|
userSelect: "none",
|
||||||
|
display: "flex",
|
||||||
|
width: "30%"
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{captcha}
|
||||||
|
</Box>
|
||||||
|
<Button variant="outline" size="xs" onClick={regenerateCaptcha}>
|
||||||
|
Refresh
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</Group>
|
||||||
</Flex>
|
<TextInput
|
||||||
</Box>
|
label="Enter CAPTCHA"
|
||||||
</Stack>
|
size="md"
|
||||||
</Card>
|
placeholder="Enter above text"
|
||||||
</div>
|
value={inputCaptcha}
|
||||||
|
onChange={(e) => setInputCaptcha(e.currentTarget.value)}
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<Button type="submit" disabled={isLogging} fullWidth variant="filled" mt="md">
|
||||||
|
{/* Login */}
|
||||||
|
{isLogging ? "Logging.." : "Login"}
|
||||||
|
</Button>
|
||||||
|
</form>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
</Stack>
|
||||||
|
</Card>
|
||||||
|
{/* </div> */}
|
||||||
</div>
|
</div>
|
||||||
<Box style={{
|
<Box style={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
|
Reference in New Issue
Block a user