From 7b91944a293eb27f2aa1ae2838d435700530653c Mon Sep 17 00:00:00 2001 From: Michael Kret <88898367+michael-radency@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:03:16 +0300 Subject: [PATCH] fix(n8n Form Trigger Node): Show basic authentication modal on wrong credentials (#10423) --- packages/nodes-base/nodes/Form/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/Form/utils.ts b/packages/nodes-base/nodes/Form/utils.ts index 079ae4278c2d9..35f06496cef4c 100644 --- a/packages/nodes-base/nodes/Form/utils.ts +++ b/packages/nodes-base/nodes/Form/utils.ts @@ -170,8 +170,8 @@ export async function formWebhook( } } catch (error) { if (error instanceof WebhookAuthorizationError) { - res.writeHead(error.responseCode, { 'WWW-Authenticate': 'Basic realm="Webhook"' }); - res.end(error.message); + res.setHeader('WWW-Authenticate', 'Basic realm="Enter credentials"'); + res.status(401).send(); return { noWebhookResponse: true }; } throw error;