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:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user