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 });
|
||||
}
|
||||
const encodedData = String(data);
|
||||
// Redirect browser to page UI with data
|
||||
console.log ("Return to the Urls.");
|
||||
return NextResponse.redirect(
|
||||
new URL(`/eMandate/login/page?data=${encodedData}`, req.url)
|
||||
);
|
||||
const forwardedHost =
|
||||
req.headers.get("x-forwarded-host") || "netbankingtest.kccb.in";
|
||||
const forwardedProto = req.headers.get("x-forwarded-proto") || "https";
|
||||
|
||||
const redirectUrl = `${forwardedProto}://${forwardedHost}/eMandate/login/page?data=${encodedData}`;
|
||||
|
||||
console.log("Redirecting to:", redirectUrl);
|
||||
return NextResponse.redirect(redirectUrl);
|
||||
|
||||
} catch (error) {
|
||||
console.error("Error handling POST:", error);
|
||||
return NextResponse.json({ error: "Internal Server Error" }, { status: 500 });
|
||||
|
||||
Reference in New Issue
Block a user