diff --git a/packages/console/src/pages/EnterpriseSsoDetails/IdpInitiatedAuth/ConfigForm.tsx b/packages/console/src/pages/EnterpriseSsoDetails/IdpInitiatedAuth/ConfigForm.tsx index 31d3670ba..7bc13d9bd 100644 --- a/packages/console/src/pages/EnterpriseSsoDetails/IdpInitiatedAuth/ConfigForm.tsx +++ b/packages/console/src/pages/EnterpriseSsoDetails/IdpInitiatedAuth/ConfigForm.tsx @@ -58,7 +58,7 @@ function ConfigForm({ handleSubmit, watch, } = useForm({ - defaultValues: parseResponseToFormData(idpInitiatedAuthConfig), + defaultValues: parseResponseToFormData(idpInitiatedAuthConfig, applications), }); const isIdpInitiatedSsoEnabled = watch('isIdpInitiatedSsoEnabled'); @@ -98,8 +98,9 @@ function ConfigForm({ useEffect(() => { if (defaultApplication?.type === ApplicationType.SPA) { setValue('config.autoSendAuthorizationRequest', false); + setValue('config.redirectUri', undefined); } - }, [defaultApplication?.type, setValue]); + }, [defaultApplication, setValue]); const onSubmit = handleSubmit( trySubmitSafe(async (data) => { @@ -113,7 +114,7 @@ function ConfigForm({ await api.delete(buildIdpInitiatedAuthConfigEndpoint(ssoConnector.id)); await mutateIdpInitiatedConfig(); toast.success(t('general.saved')); - reset(parseResponseToFormData()); + reset(parseResponseToFormData(undefined, applications)); return; } @@ -172,6 +173,9 @@ function ConfigForm({ }} render={({ field: { value, onChange } }) => (