feat : after successful OTP I send the return request.
This commit is contained in:
@@ -126,8 +126,29 @@ export default function VerifyOtpPage() {
|
|||||||
const success = await verifyOtp(otp, mobile);
|
const success = await verifyOtp(otp, mobile);
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
setTimeout(() => router.push("/eMandate/mandate_page"), 1500);
|
const encoded_data = localStorage.getItem("Validate_data");
|
||||||
} else {
|
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("");
|
setOtp("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user