fix: E mandate Login and logout page

This commit is contained in:
2025-11-12 15:15:48 +05:30
parent f1ff27ccf0
commit c2c87f8c71
5 changed files with 322 additions and 207 deletions

View File

@@ -1,35 +1,3 @@
// import { NextResponse } from "next/server";
// export async function POST(req: Request) {
// try {
// const formData = await req.formData();
// const data = formData.get("data");
// const mandateReqDoc = formData.get("mandateReqDoc");
// const mndtType = formData.get("mndtType");
// // const { searchParams } = new URL(req.url);
// // const data = searchParams.get("data");
// // const mandateReqDoc = searchParams.get("mandateReqDoc");
// // const mndtType = searchParams.get("mndtType");
// console.log("Received from SoftTech:", { data, mandateReqDoc, mndtType });
// if (!data) {
// return NextResponse.json({ error: "Missing data" }, { status: 400 });
// }
// const encodedData = String(data);
// 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 });
// }
// }
import { NextResponse } from "next/server";
export async function POST(req: Request) {