Production code

feat : 2 factor authentication , OTP service , Session timeout
This commit is contained in:
2025-10-15 11:50:25 +05:30
parent 569e31bf12
commit ad19f0cb4c
7 changed files with 62 additions and 40 deletions

View File

@@ -7,4 +7,23 @@
- npm run build
- npm run start
- npm run dev
- npm run dev
## URls
- For user
```
http://localhost:3000/login
```
- For admin
```
http://localhost:3000/administrator/login
```
- For E-mandate
```
http://localhost:3000/eMandate/login
```

View File

@@ -15,8 +15,8 @@
- Limit of transaction daily --Asif
- >Statement Download
- >In Every OTP page "Resend button" & 3 min timing of expiry.
- OTP binding with actual mobile number.
- Beneficiary delete feature
- >OTP binding with actual mobile number.
- >Beneficiary delete feature
- IN settings page NOTE position Fixing.
- >Admin page
- >give rights
@@ -27,7 +27,7 @@
<!-- - Make every page responsive (need to check settings and payment tab) -->
- Locked (3 times wrong password in time of login)
- >session timeout
- login time otp
- >login time otp
<!-- - narration (in statement) Last 10 transaction the remarks not comes from subham sites-->

View File

@@ -11,29 +11,31 @@ ____________________________________________________________
<!-- IB is the service name -->
- vi IB.service
```
[Unit]
Description= Internet Banking Frontened Application in Node
After=network.target
[Service]
# Use absolute path for node or npm
User=ib
Group=ib
ExecStart=/usr/bin/npm start
WorkingDirectory=/home/ib/IB
Restart=on-failure
RestartSec=5
Environment=NODE_ENV=production
Environment=PORT=3000
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
[Unit]
Description= Internet Banking Frontened Application in Node
After=network.target
[Service]
# Use absolute path for node or npm
User=ib_new
Group=ib_new
WorkingDirectory=/home/ib_new/IB
Environment=PATH=/home/ib_new/.local/bin:/home/ib_new/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/opt/node-v20.19.5-linux-x64/bin
ExecStart=/opt/node-v20.19.5-linux-x64/bin/npm start
Restart=on-failure
RestartSec=5
Environment=NODE_ENV=production
Environment=PORT=3000
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
<All value are changed as per domain>
```
- sudo systemctl status IB
- sudo systemctl start IB
- sudo journalctl -u IB
- sudo systemctl stop IB
- sudo systemctl restart IB
@@ -44,7 +46,9 @@ ____________________________________________________________
UAT (IB- frontend Test) : i-0b55435e15425f1c3
Linux : i-0c850dcf8b85b1447 (Test)
Prod : i-088e64c3435cb5078 (For IB & MB)
# Prod : i-088e64c3435cb5078 (For IB & MB) --old
Prod : i-070a81f88a984f7c6 (For IB and MB)
Mobile banking Prod DB: i-086d4cb13afc2cd83 //IB user: ib_new psw: ib_new
```
## 2. list of Port :

View File

@@ -1,4 +1,8 @@
/** @type {import('next').NextConfig} */
import os from "os";
const isWindows = os.platform() === "win32";
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["typeorm", "knex"],
@@ -6,15 +10,12 @@ const nextConfig = {
reactStrictMode: true,
// For port transfer
async rewrites() {
return[
return [
{
source:'/api/:path*',
destination: 'http://localhost:8080/api/:path*',
// prod
// destination : 'http://lb-kccb-mobile-banking-app-848675342.ap-south-1.elb.amazonaws.com:8080/api/:path*',
// Testing
// destination: 'http://lb-test-mobile-banking-app-192209417.ap-south-1.elb.amazonaws.com:8080/api/:path*',
source: '/api/:path*',
destination: isWindows
? "http://localhost:8080/api/:path*" // For Windows
: "https://kccbmbnk.net/api/:path*", // For Linux/Mac/Server
},
];
},

View File

@@ -19,7 +19,7 @@ export default function ValidateUser() {
const headerRef = useRef<HTMLHeadingElement>(null);
const validUsers = [
{ cif: "11111111111", mobile: "6297421727" },
{ cif: "11111111111", mobile: "7890544528" },
{ cif: "30022497139", mobile: "6230573848" },
{ cif: "11122233344", mobile: "9998887776" },
];

View File

@@ -16,8 +16,8 @@ interface SendOtpPayload {
}
function getStoredMobileNumber(): string | null {
// const mobileNumber = localStorage.getItem('remitter_mobile_no');
const mobileNumber = "6297421727";
const mobileNumber = localStorage.getItem('remitter_mobile_no');
// const mobileNumber = "7890544527";
if (!mobileNumber) {
notifications.show({
title: 'Missing Mobile Number',

View File

@@ -13,7 +13,6 @@ import dynamic from 'next/dynamic';
import { generateCaptcha } from '@/app/captcha';
import { IconRefresh, IconShieldLockFilled } from "@tabler/icons-react";
import dayjs from "dayjs";
import { IconTrash } from "@tabler/icons-react";
import { fetchAndStoreUserName } from "../_util/userdetails";
@@ -47,8 +46,8 @@ export default function Login() {
}
try {
console.log(CIF);
// 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: mobile });
// await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: '7890544527' });
notifications.show({
color: "orange",
title: "OTP Required",
@@ -69,8 +68,8 @@ export default function Login() {
async function handleVerifyOtp(mobile?: string) {
try {
if (mobile) {
// await verifyLoginOtp(otp, mobile);
await verifyLoginOtp(otp, '6297421727');
await verifyLoginOtp(otp, mobile);
// await verifyLoginOtp(otp, '7890544527');
return true;
}
} catch {
@@ -102,7 +101,6 @@ export default function Login() {
}, []);
const regenerateCaptcha = () => {
// setCaptcha(generateCaptcha());
const loadCaptcha = async () => {
const newCaptcha = await generateCaptcha();
setCaptcha(newCaptcha);