diff --git a/apps/dashboard/src/components/embedded-wallets/Configure/index.tsx b/apps/dashboard/src/components/embedded-wallets/Configure/index.tsx index 0cbbc1d71d3..6fd43deeaab 100644 --- a/apps/dashboard/src/components/embedded-wallets/Configure/index.tsx +++ b/apps/dashboard/src/components/embedded-wallets/Configure/index.tsx @@ -417,14 +417,9 @@ function AuthEndpointFields(props: { canEditAdvancedFeatures: boolean; }) { const { form, canEditAdvancedFeatures } = props; - const customHeaderFields = useFieldArray({ - control: form.control, - name: "customAuthEndpoint.customHeaders", - }); const expandCustomAuthEndpointField = - form.watch("customAuthEndpoint")?.authEndpoint !== undefined && - canEditAdvancedFeatures; + form.watch("customAuthEndpoint") !== undefined && canEditAdvancedFeatures; return (
@@ -464,88 +459,107 @@ function AuthEndpointFields(props: { }} /> + {/* useFieldArray used on this component - it creates empty customAuthEndpoint.customHeaders array on mount */} + {/* So only mount if expandCustomAuthEndpointField is true */} + {expandCustomAuthEndpointField && ( + + )} +
+ ); +} - - ( - - Authentication Endpoint - +function AuthEndpointFieldsContent(props: { + form: UseFormReturn; + canEditAdvancedFeatures: boolean; +}) { + const { form } = props; + + const customHeaderFields = useFieldArray({ + control: form.control, + name: "customAuthEndpoint.customHeaders", + }); + + return ( +
+ ( + + Authentication Endpoint + + + + + Enter the URL of your server where we will send the user payload + for verification + + + + )} + /> + +
+ +
+ {customHeaderFields.fields.map((field, customHeaderIdx) => { + return ( +
- - - Enter the URL of your server where we will send the user payload - for verification - - - - )} - /> - -
- -
- {customHeaderFields.fields.map((field, customHeaderIdx) => { - return ( -
- - - -
- ); - })} - - -
- -

- Set custom headers to be sent along the request with the payload to - the authentication endpoint above. This can be used to verify the - incoming requests -

+ + +
+ ); + })} + +
- + +

+ Set custom headers to be sent along the request with the payload to + the authentication endpoint above. This can be used to verify the + incoming requests +

+
); }