Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: Move confirm email setting from email provider to basic auth settings (#37573)

Ivan Vasilov9fda63d9baea
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 = () => {
</Alert_Shadcn_>
)}
</CardContent>
+ <CardContent>
+ <FormField_Shadcn_
+ control={form.control}
+ name="MAILER_AUTOCONFIRM"
+ render={({ field }) => (
+ <FormItemLayout
+ layout="flex-row-reverse"
+ label="Confirm email"
+ description="Users will need to confirm their email address before signing in for the first time"
+ >
+ <FormControl_Shadcn_>
+ <Switch
+ checked={field.value}
+ onCheckedChange={field.onChange}
+ disabled={!canUpdateConfig}
+ />
+ </FormControl_Shadcn_>
+ </FormItemLayout>
+ )}
+ />
+ </CardContent>
<CardFooter className="justify-end space-x-2">
{form.formState.isDirty && (
<Button type="default" onClick={() => form.reset()}>