feat : after successful OTP I send the return request.

This commit is contained in:
2025-12-08 12:33:08 +05:30
parent ad758eb14d
commit 74297959d7

View File

@@ -126,8 +126,29 @@ export default function VerifyOtpPage() {
const success = await verifyOtp(otp, mobile);
if (success) {
setTimeout(() => router.push("/eMandate/mandate_page"), 1500);
} else {
const encoded_data = localStorage.getItem("Validate_data");
const res = await fetch(
`https://apiemandate.kccb.in:9035/Emandate/auth-cbs-resp?data=${encoded_data}`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
}
);
const result = await res.json();
console.log(result);
if (!res.ok) {
throw new Error("CBS response API failed");
}
if (res.ok) {
// navigate only after successful API hit
setTimeout(() => {
router.push("/eMandate/mandate_page");
}, 1500);
}
}
else {
setOtp("");
}