fix: eMandate
This commit is contained in:
@@ -39,16 +39,12 @@ export async function POST(req: Request) {
|
|||||||
const mandateReqDoc = formData.get("mandateReqDoc");
|
const mandateReqDoc = formData.get("mandateReqDoc");
|
||||||
const mndtType = formData.get("mndtType");
|
const mndtType = formData.get("mndtType");
|
||||||
|
|
||||||
|
console.log("Received from SoftTech:", { data, mandateReqDoc, mndtType });
|
||||||
const forwardedHost = req.headers.get("x-forwarded-host") || req.headers.get("host");
|
const forwardedHost = req.headers.get("x-forwarded-host") || req.headers.get("host");
|
||||||
const forwardedProto = req.headers.get("x-forwarded-proto") || "https";
|
const forwardedProto = req.headers.get("x-forwarded-proto") || "https";
|
||||||
|
const encodedData = String(data);
|
||||||
|
|
||||||
const params = new URLSearchParams({
|
const redirectUrl = `${forwardedProto}://${forwardedHost}/eMandate/login/page?data=${encodedData}`;
|
||||||
data: String(data),
|
|
||||||
mandateReqDoc: mandateReqDoc ? String(mandateReqDoc) : "",
|
|
||||||
mndtType: mndtType ? String(mndtType) : "",
|
|
||||||
});
|
|
||||||
|
|
||||||
const redirectUrl = `${forwardedProto}://${forwardedHost}/eMandate/login/page?${params.toString()}`;
|
|
||||||
|
|
||||||
const response = NextResponse.redirect(redirectUrl, 303); // use 303 instead of 302
|
const response = NextResponse.redirect(redirectUrl, 303); // use 303 instead of 302
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user