fix: emandate issue
This commit is contained in:
@@ -15,11 +15,15 @@ export async function POST(req: Request) {
|
|||||||
return NextResponse.json({ error: "Missing data" }, { status: 400 });
|
return NextResponse.json({ error: "Missing data" }, { status: 400 });
|
||||||
}
|
}
|
||||||
const encodedData = String(data);
|
const encodedData = String(data);
|
||||||
// Redirect browser to page UI with data
|
const forwardedHost =
|
||||||
console.log ("Return to the Urls.");
|
req.headers.get("x-forwarded-host") || "netbankingtest.kccb.in";
|
||||||
return NextResponse.redirect(
|
const forwardedProto = req.headers.get("x-forwarded-proto") || "https";
|
||||||
new URL(`/eMandate/login/page?data=${encodedData}`, req.url)
|
|
||||||
);
|
const redirectUrl = `${forwardedProto}://${forwardedHost}/eMandate/login/page?data=${encodedData}`;
|
||||||
|
|
||||||
|
console.log("Redirecting to:", redirectUrl);
|
||||||
|
return NextResponse.redirect(redirectUrl);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error handling POST:", error);
|
console.error("Error handling POST:", error);
|
||||||
return NextResponse.json({ error: "Internal Server Error" }, { status: 500 });
|
return NextResponse.json({ error: "Internal Server Error" }, { status: 500 });
|
||||||
|
|||||||
Reference in New Issue
Block a user