feat : fix the login login.
feat : in "fund transfer" user can send money from SA and SB account
This commit is contained in:
@@ -47,7 +47,17 @@ Linux : i-0c850dcf8b85b1447 (Test)
|
|||||||
Prod : i-088e64c3435cb5078 (For IB & MB)
|
Prod : i-088e64c3435cb5078 (For IB & MB)
|
||||||
```
|
```
|
||||||
|
|
||||||
## 2. Port Forwarding
|
## 2. list of Port :
|
||||||
|
- 8686 (fetch the customer details)
|
||||||
|
- 5432 (postgres)
|
||||||
|
- 8080 (IB- backend port)
|
||||||
|
- 8688 (fetch the account statement)
|
||||||
|
- 8687 (for customer name fetch in CBS -- when add beneficiary)
|
||||||
|
- 8689 (payment port)
|
||||||
|
- 6379( redis port)
|
||||||
|
|
||||||
|
|
||||||
|
## 3. Port Forwarding
|
||||||
|
|
||||||
### API (localhost → EC2:8080)
|
### API (localhost → EC2:8080)
|
||||||
```bash
|
```bash
|
||||||
@@ -100,21 +110,21 @@ SELECT * FROM users;
|
|||||||
# Grant permissions
|
# Grant permissions
|
||||||
grant select, insert, update, delete on table admin to kmobile_app_rw;
|
grant select, insert, update, delete on table admin to kmobile_app_rw;
|
||||||
```
|
```
|
||||||
## 4. Linux Machine Access
|
## 5. Linux Machine Access
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Run the .bat file first
|
# Run the .bat file first
|
||||||
ssh username@localhost
|
ssh username@localhost
|
||||||
# Enter your password
|
# Enter your password
|
||||||
```
|
```
|
||||||
## Copy File from Local → Linux
|
## 6.Copy File from Local → Linux
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
scp -P 9022 Smsservice/smsserviceapplication.jar <username>@localhost:/home/<username>
|
scp -P 9022 Smsservice/smsserviceapplication.jar <username>@localhost:/home/<username>
|
||||||
|
|
||||||
# ssh nabanita@localhost -p 9022
|
# ssh nabanita@localhost -p 9022
|
||||||
```
|
```
|
||||||
## About Backend
|
## 7.About Backend
|
||||||
|
|
||||||
- If user "is_first_login" = true means Users did not login in IB.
|
- If user "is_first_login" = true means Users did not login in IB.
|
||||||
- **ib_access_level** or **mb_access_level**
|
- **ib_access_level** or **mb_access_level**
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export default function OutsideQuickPay() {
|
|||||||
});
|
});
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
if (response.ok && Array.isArray(data)) {
|
if (response.ok && Array.isArray(data)) {
|
||||||
const filterSAaccount = data.filter((acc) => acc.stAccountType === 'SA');
|
const filterSAaccount = data.filter((acc) => ['SA', 'SB'].includes(acc.stAccountType));
|
||||||
setAccountData(filterSAaccount);
|
setAccountData(filterSAaccount);
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ export default function QuickPay() {
|
|||||||
});
|
});
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
if (response.ok && Array.isArray(data)) {
|
if (response.ok && Array.isArray(data)) {
|
||||||
const filterSAaccount = data.filter((acc) => acc.stAccountType === 'SA');
|
const filterSAaccount = data.filter((acc) => ['SA', 'SB'].includes(acc.stAccountType));
|
||||||
setAccountData(filterSAaccount);
|
setAccountData(filterSAaccount);
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ export default function SendToBeneficiaryOwn() {
|
|||||||
});
|
});
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
if (response.ok && Array.isArray(data)) {
|
if (response.ok && Array.isArray(data)) {
|
||||||
const filterSAaccount = data.filter((acc) => acc.stAccountType === 'SA');
|
const filterSAaccount = data.filter((acc) => ['SA', 'SB'].includes(acc.stAccountType));
|
||||||
setAccountData(filterSAaccount);
|
setAccountData(filterSAaccount);
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ export default function SendToBeneficiaryOthers() {
|
|||||||
});
|
});
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
if (response.ok && Array.isArray(data)) {
|
if (response.ok && Array.isArray(data)) {
|
||||||
const filterSAaccount = data.filter((acc) => acc.stAccountType === 'SA');
|
const filterSAaccount = data.filter((acc) => ['SA', 'SB'].includes(acc.stAccountType));
|
||||||
setAccountData(filterSAaccount);
|
setAccountData(filterSAaccount);
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -49,6 +49,11 @@ export default function Login() {
|
|||||||
console.log(CIF);
|
console.log(CIF);
|
||||||
// await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: mobile });
|
// await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: mobile });
|
||||||
await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: '7890544527' });
|
await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: '7890544527' });
|
||||||
|
notifications.show({
|
||||||
|
color: "orange",
|
||||||
|
title: "OTP Required",
|
||||||
|
message: "OTP sent to your registered mobile number",
|
||||||
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (err: any) {
|
catch (err: any) {
|
||||||
@@ -106,202 +111,10 @@ export default function Login() {
|
|||||||
setInputCaptcha("");
|
setInputCaptcha("");
|
||||||
};
|
};
|
||||||
|
|
||||||
// async function handleLogin(e: React.FormEvent) {
|
|
||||||
// e.preventDefault();
|
|
||||||
|
|
||||||
// if (!otpRequired && !otpVerified) {
|
|
||||||
// const onlyDigit = /^\d{11}$/;
|
|
||||||
// if (!onlyDigit.test(CIF)) {
|
|
||||||
// // setError('Input value must be 11 digit');
|
|
||||||
// notifications.show({
|
|
||||||
// withBorder: true,
|
|
||||||
// color: "red",
|
|
||||||
// title: "Invalid UserId",
|
|
||||||
// message: "UserID must be 11 digit",
|
|
||||||
// autoClose: 5000,
|
|
||||||
// });
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (!inputCaptcha) {
|
|
||||||
// notifications.show({
|
|
||||||
// withBorder: true,
|
|
||||||
// color: "red",
|
|
||||||
// title: "Invalid Captcha",
|
|
||||||
// message: "Please fill the Captcha filed",
|
|
||||||
// autoClose: 5000,
|
|
||||||
// });
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (inputCaptcha !== captcha) {
|
|
||||||
// notifications.show({
|
|
||||||
// withBorder: true,
|
|
||||||
// color: "red",
|
|
||||||
// title: "Captcha Error",
|
|
||||||
// message: "Please enter the correct captcha",
|
|
||||||
// autoClose: 5000,
|
|
||||||
// });
|
|
||||||
// regenerateCaptcha();
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (!CIF || !psw) {
|
|
||||||
// notifications.show({
|
|
||||||
// withBorder: true,
|
|
||||||
// color: "red",
|
|
||||||
// title: "Invalid Input",
|
|
||||||
// message: "Please fill UserId and Password",
|
|
||||||
// autoClose: 5000,
|
|
||||||
// });
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// try {
|
|
||||||
// if (!otpRequired || otpVerified) {
|
|
||||||
// const response = await fetch('api/auth/login', {
|
|
||||||
// method: 'POST',
|
|
||||||
// headers: {
|
|
||||||
// 'Content-Type': 'application/json',
|
|
||||||
// 'X-Login-Type': 'IB',
|
|
||||||
// },
|
|
||||||
// body: JSON.stringify({
|
|
||||||
// customerNo: CIF,
|
|
||||||
// password: psw,
|
|
||||||
// otp: otp
|
|
||||||
// }),
|
|
||||||
// });
|
|
||||||
// const data = await response.json();
|
|
||||||
// console.log(data);
|
|
||||||
// setIsLogging(true);
|
|
||||||
|
|
||||||
// if (data.status === "OTP_REQUIRED" && response.status === 202) {
|
|
||||||
// console.log(data.mobile);
|
|
||||||
// setMobile(data.mobile);
|
|
||||||
// setOtpRequired(true);
|
|
||||||
// setButtonLabel("Verify OTP");
|
|
||||||
|
|
||||||
// const otpSent = await handleSendOtp(data.mobile); // auto-send
|
|
||||||
// if (otpSent) {
|
|
||||||
// notifications.show({
|
|
||||||
// color: "orange",
|
|
||||||
// title: "OTP Required",
|
|
||||||
// message: "OTP sent to your registered mobile number",
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (data.error === "MIGRATED_USER_HAS_NO_PASSWORD") {
|
|
||||||
// //console.log("Migration issue detected → opening modal");
|
|
||||||
// setOpened(true);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (!response.ok) {
|
|
||||||
// notifications.show({
|
|
||||||
// withBorder: true,
|
|
||||||
// color: "red",
|
|
||||||
// title: "Error",
|
|
||||||
// message: data?.error || "Internal Server Error",
|
|
||||||
// autoClose: 5000,
|
|
||||||
// });
|
|
||||||
// regenerateCaptcha();
|
|
||||||
// localStorage.removeItem("access_token");
|
|
||||||
// localStorage.clear();
|
|
||||||
// sessionStorage.clear();
|
|
||||||
// return;
|
|
||||||
|
|
||||||
// }
|
|
||||||
// // setIsLogging(true);
|
|
||||||
// if (response.ok) {
|
|
||||||
// // console.log(data);
|
|
||||||
// setOtp("");
|
|
||||||
// const token = data.token;
|
|
||||||
// localStorage.setItem("access_token", token);
|
|
||||||
// localStorage.setItem("pswExpiryDate", data.loginPswExpiry);
|
|
||||||
// // console.log("Expiry Date:",(dayjs(data.loginPswExpiry)).diff(dayjs(), "day"));
|
|
||||||
|
|
||||||
// // Password Expiry Logic
|
|
||||||
// if (data.loginPswExpiry && (dayjs(data.loginPswExpiry)).diff(dayjs(), "day") < 0) {
|
|
||||||
// notifications.show({
|
|
||||||
// withBorder: true,
|
|
||||||
// color: "orange",
|
|
||||||
// title: "Password Expired",
|
|
||||||
// message: "Your password has expired, please set a new one.",
|
|
||||||
// autoClose: 4000,
|
|
||||||
// });
|
|
||||||
// router.push("/ChangePassword");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (data.FirstTimeLogin === true) {
|
|
||||||
// router.push("/SetPassword")
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// router.push("/home");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// regenerateCaptcha();
|
|
||||||
// setIsLogging(false);
|
|
||||||
// notifications.show({
|
|
||||||
// withBorder: true,
|
|
||||||
// color: "red",
|
|
||||||
// title: "Wrong User Id or Password",
|
|
||||||
// message: "Wrong User Id or Password",
|
|
||||||
// autoClose: 5000,
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (otpRequired && !otpVerified) {
|
|
||||||
// if (!otp) {
|
|
||||||
// notifications.show({
|
|
||||||
// color: "red",
|
|
||||||
// title: "Invalid OTP",
|
|
||||||
// message: "Please enter OTP before verifying",
|
|
||||||
// });
|
|
||||||
// setIsLogging(false);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// console.log("hi verify mob", mobile);
|
|
||||||
// const verified = await handleVerifyOtp(mobile);
|
|
||||||
// if (!verified) {
|
|
||||||
// notifications.show({
|
|
||||||
// title: "Invalid OTP",
|
|
||||||
// message: "The OTP entered does not match",
|
|
||||||
// color: "red",
|
|
||||||
// });
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// notifications.show({
|
|
||||||
// color: "green",
|
|
||||||
// title: "OTP Verified",
|
|
||||||
// message: "Please click Login to continue",
|
|
||||||
// });
|
|
||||||
// setOtpVerified(true);
|
|
||||||
// setButtonLabel("Login");
|
|
||||||
// setIsLogging(false);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// catch (error: any) {
|
|
||||||
// notifications.show({
|
|
||||||
// withBorder: true,
|
|
||||||
// color: "red",
|
|
||||||
// title: "Error",
|
|
||||||
// message: "Internal Server Error,Please try again Later",
|
|
||||||
// autoClose: 5000,
|
|
||||||
// });
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// finally {
|
|
||||||
// setIsLogging(false);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// For migration User
|
|
||||||
async function handleLogin(e: React.FormEvent) {
|
async function handleLogin(e: React.FormEvent) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
if (isLogging) return;
|
||||||
setIsLogging(true); // show loading & disable inputs
|
setIsLogging(true); // show loading & disable inputs
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -384,13 +197,13 @@ export default function Login() {
|
|||||||
setButtonLabel("Verify OTP");
|
setButtonLabel("Verify OTP");
|
||||||
|
|
||||||
const otpSent = await handleSendOtp(data.mobile);
|
const otpSent = await handleSendOtp(data.mobile);
|
||||||
if (otpSent) {
|
// if (otpSent) {
|
||||||
notifications.show({
|
// notifications.show({
|
||||||
color: "orange",
|
// color: "orange",
|
||||||
title: "OTP Required",
|
// title: "OTP Required",
|
||||||
message: "OTP sent to your registered mobile number",
|
// message: "OTP sent to your registered mobile number",
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
setIsLogging(false);
|
setIsLogging(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -775,7 +588,7 @@ export default function Login() {
|
|||||||
onChange={(e) => setOtp(e.currentTarget.value)}
|
onChange={(e) => setOtp(e.currentTarget.value)}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
style={{ flex: 1 }}
|
style={{ flex: 1 }}
|
||||||
readOnly={otpVerified}
|
disabled={otpVerified}
|
||||||
/>
|
/>
|
||||||
<Tooltip label="Resend OTP">
|
<Tooltip label="Resend OTP">
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user