From f1e5a7cfa76aa0dc95a52343fcb7429967a8e4ee Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 18:54:13 -0400 Subject: [PATCH] Fix passkey login 400 error when authenticatorAttachment is undefined (#11856) * Initial plan * Fix passkey login 400 error when authenticatorAttachment is undefined Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> Agent-Logs-Url: https://github.com/outline/outline/sessions/b7ea5777-cd06-41e7-a796-70ea083dfc34 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> --- app/scenes/Login/components/AuthenticationProvider.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/scenes/Login/components/AuthenticationProvider.tsx b/app/scenes/Login/components/AuthenticationProvider.tsx index 0dad1a8a98..e5c275ecc1 100644 --- a/app/scenes/Login/components/AuthenticationProvider.tsx +++ b/app/scenes/Login/components/AuthenticationProvider.tsx @@ -89,12 +89,16 @@ function AuthenticationProvider(props: Props) { // Populate hidden form fields with authentication data if (formRef.current) { - const createInputs = (obj: any, prefix = "") => { + const createInputs = (obj: Record, prefix = "") => { Object.entries(obj).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + const fieldName = prefix ? `${prefix}[${key}]` : key; - if (value && typeof value === "object" && !Array.isArray(value)) { - createInputs(value, fieldName); + if (typeof value === "object" && !Array.isArray(value)) { + createInputs(value as Record, fieldName); } else { // Create hidden input for primitive values const input = document.createElement("input");