mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user