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");