feat : From home page user can get statement.

feat :Session timeout for 5 min
feat : login time two step verification
This commit is contained in:
2025-10-13 11:59:58 +05:30
parent 922e4356ce
commit b5cc4ac714
4 changed files with 460 additions and 112 deletions

View File

@@ -12,6 +12,7 @@ interface SendOtpPayload {
ref?: string;
date?: string;
userOtp?: string;
username?:string
}
function getStoredMobileNumber(): string | null {
@@ -43,7 +44,6 @@ export async function sendOtp(payload: SendOtpPayload) {
}
}
export async function verifyOtp(otp: string) {
try {
const mobileNumber = getStoredMobileNumber();
@@ -58,3 +58,18 @@ export async function verifyOtp(otp: string) {
throw error.response?.data || error;
}
}
export async function verifyLoginOtp(otp: string,mobileNumber:string) {
try {
// const mobileNumber = getStoredMobileNumber();
const response = await axios.post(
`http://localhost:8080/api/otp/verify?mobileNumber=${mobileNumber}`,
{ otp },
{ headers: { 'Content-Type': 'application/json' } }
);
return response.data;
} catch (error: any) {
console.error('Error verifying OTP:', error.response?.data || error.message);
throw error.response?.data || error;
}
}