This commit is contained in:
Max Peintner
2025-03-12 08:41:26 +01:00
parent 3bed1c7b27
commit 2ecd8bad59

View File

@@ -475,18 +475,12 @@ export async function GET(request: NextRequest) {
if (url && binding.case === "redirect") { if (url && binding.case === "redirect") {
return NextResponse.redirect(url); return NextResponse.redirect(url);
} else if (url && binding.case === "post") { } else if (url && binding.case === "post") {
const formData = {
relayState: binding.value.relayState,
samlResponse: binding.value.samlResponse,
};
// Convert form data to URL-encoded string // Convert form data to URL-encoded string
const formBody = new FormData(); const formBody = new FormData();
formBody.append("RelayState", formData.relayState); formBody.append("RelayState", binding.value.relayState);
formBody.append("SAMLResponse", formData.samlResponse); formBody.append("SAMLResponse", binding.value.samlResponse);
console.log(url)
console.log(formBody)
// Make a POST request to the external URL with the form data // Make a POST request to the external URL with the form data
const response = await fetch(url, { const response = await fetch(url, {
method: "POST", method: "POST",
@@ -495,7 +489,6 @@ export async function GET(request: NextRequest) {
}, },
body: formBody, body: formBody,
}); });
console.log(response)
// Handle the response from the external URL // Handle the response from the external URL
if (response.ok) { if (response.ok) {