From 9fda63d9baea4eacd9d172b2ab065175a6955eb2 Mon Sep 17 00:00:00 2001 From: Ivan Vasilov Date: Thu, 31 Jul 2025 09:50:09 +0200 Subject: [PATCH] fix: Move confirm email setting from email provider to basic auth settings (#37573) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Move confirm email setting from email provider to basic auth settings - Remove MAILER_AUTOCONFIRM from email provider form validation - Add confirm email setting to BasicAuthSettingsForm with proper form validation - Maintain existing functionality while improving UX by grouping related settings 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * Update BasicAuthSettingsForm.tsx * Fix the default value of email confirm. * Remove unnecessary comment. --------- Co-authored-by: Claude --- .../Auth/AuthProvidersFormValidation.tsx | 5 ---- .../BasicAuthSettingsForm.tsx | 26 ++++++++++++++++++- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx b/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx index 1931a49b408..0137a0685f3 100644 --- a/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx +++ b/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx @@ -19,11 +19,6 @@ const PROVIDER_EMAIL = { description: 'This will enable Email based signup and login for your application', type: 'boolean', }, - MAILER_AUTOCONFIRM: { - title: 'Confirm email', - description: `Users will need to confirm their email address before signing in for the first time.`, - type: 'boolean', - }, MAILER_SECURE_EMAIL_CHANGE_ENABLED: { title: 'Secure email change', description: `Users will be required to confirm any email change on both the old email address and new email address. diff --git a/apps/studio/components/interfaces/Auth/BasicAuthSettingsForm/BasicAuthSettingsForm.tsx b/apps/studio/components/interfaces/Auth/BasicAuthSettingsForm/BasicAuthSettingsForm.tsx index 18623d0ab94..54edfebbf88 100644 --- a/apps/studio/components/interfaces/Auth/BasicAuthSettingsForm/BasicAuthSettingsForm.tsx +++ b/apps/studio/components/interfaces/Auth/BasicAuthSettingsForm/BasicAuthSettingsForm.tsx @@ -35,6 +35,7 @@ const schema = object({ DISABLE_SIGNUP: boolean().required(), EXTERNAL_ANONYMOUS_USERS_ENABLED: boolean().required(), SECURITY_MANUAL_LINKING_ENABLED: boolean().required(), + MAILER_AUTOCONFIRM: boolean().required(), SITE_URL: string().required('Must have a Site URL'), }) @@ -52,6 +53,7 @@ const BasicAuthSettingsForm = () => { DISABLE_SIGNUP: true, EXTERNAL_ANONYMOUS_USERS_ENABLED: false, SECURITY_MANUAL_LINKING_ENABLED: false, + MAILER_AUTOCONFIRM: true, SITE_URL: '', }, }) @@ -61,7 +63,8 @@ const BasicAuthSettingsForm = () => { form.reset({ DISABLE_SIGNUP: !authConfig.DISABLE_SIGNUP, EXTERNAL_ANONYMOUS_USERS_ENABLED: authConfig.EXTERNAL_ANONYMOUS_USERS_ENABLED, - SECURITY_MANUAL_LINKING_ENABLED: authConfig.SECURITY_MANUAL_LINKING_ENABLED || false, + SECURITY_MANUAL_LINKING_ENABLED: authConfig.SECURITY_MANUAL_LINKING_ENABLED, + MAILER_AUTOCONFIRM: authConfig.MAILER_AUTOCONFIRM, SITE_URL: authConfig.SITE_URL, }) } @@ -250,6 +253,27 @@ const BasicAuthSettingsForm = () => { )} + + ( + + + + + + )} + /> + {form.formState.isDirty && (