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>
This commit is contained in:
Copilot
2026-03-23 18:54:13 -04:00
committed by GitHub
parent 84aed78ee2
commit f1e5a7cfa7
@@ -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<string, unknown>, 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<string, unknown>, fieldName);
} else {
// Create hidden input for primitive values
const input = document.createElement("input");