Skip to content

Commit 9fda63d

Browse files
ivasilovclaude
andauthored
fix: Move confirm email setting from email provider to basic auth settings (supabase#37573)
* 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 <[email protected]> * Update BasicAuthSettingsForm.tsx * Fix the default value of email confirm. * Remove unnecessary comment. --------- Co-authored-by: Claude <[email protected]>
1 parent 333e11f commit 9fda63d

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ const PROVIDER_EMAIL = {
1919
description: 'This will enable Email based signup and login for your application',
2020
type: 'boolean',
2121
},
22-
MAILER_AUTOCONFIRM: {
23-
title: 'Confirm email',
24-
description: `Users will need to confirm their email address before signing in for the first time.`,
25-
type: 'boolean',
26-
},
2722
MAILER_SECURE_EMAIL_CHANGE_ENABLED: {
2823
title: 'Secure email change',
2924
description: `Users will be required to confirm any email change on both the old email address and new email address.

apps/studio/components/interfaces/Auth/BasicAuthSettingsForm/BasicAuthSettingsForm.tsx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const schema = object({
3535
DISABLE_SIGNUP: boolean().required(),
3636
EXTERNAL_ANONYMOUS_USERS_ENABLED: boolean().required(),
3737
SECURITY_MANUAL_LINKING_ENABLED: boolean().required(),
38+
MAILER_AUTOCONFIRM: boolean().required(),
3839
SITE_URL: string().required('Must have a Site URL'),
3940
})
4041

@@ -52,6 +53,7 @@ const BasicAuthSettingsForm = () => {
5253
DISABLE_SIGNUP: true,
5354
EXTERNAL_ANONYMOUS_USERS_ENABLED: false,
5455
SECURITY_MANUAL_LINKING_ENABLED: false,
56+
MAILER_AUTOCONFIRM: true,
5557
SITE_URL: '',
5658
},
5759
})
@@ -61,7 +63,8 @@ const BasicAuthSettingsForm = () => {
6163
form.reset({
6264
DISABLE_SIGNUP: !authConfig.DISABLE_SIGNUP,
6365
EXTERNAL_ANONYMOUS_USERS_ENABLED: authConfig.EXTERNAL_ANONYMOUS_USERS_ENABLED,
64-
SECURITY_MANUAL_LINKING_ENABLED: authConfig.SECURITY_MANUAL_LINKING_ENABLED || false,
66+
SECURITY_MANUAL_LINKING_ENABLED: authConfig.SECURITY_MANUAL_LINKING_ENABLED,
67+
MAILER_AUTOCONFIRM: authConfig.MAILER_AUTOCONFIRM,
6568
SITE_URL: authConfig.SITE_URL,
6669
})
6770
}
@@ -250,6 +253,27 @@ const BasicAuthSettingsForm = () => {
250253
</Alert_Shadcn_>
251254
)}
252255
</CardContent>
256+
<CardContent>
257+
<FormField_Shadcn_
258+
control={form.control}
259+
name="MAILER_AUTOCONFIRM"
260+
render={({ field }) => (
261+
<FormItemLayout
262+
layout="flex-row-reverse"
263+
label="Confirm email"
264+
description="Users will need to confirm their email address before signing in for the first time"
265+
>
266+
<FormControl_Shadcn_>
267+
<Switch
268+
checked={field.value}
269+
onCheckedChange={field.onChange}
270+
disabled={!canUpdateConfig}
271+
/>
272+
</FormControl_Shadcn_>
273+
</FormItemLayout>
274+
)}
275+
/>
276+
</CardContent>
253277
<CardFooter className="justify-end space-x-2">
254278
{form.formState.isDirty && (
255279
<Button type="default" onClick={() => form.reset()}>

0 commit comments

Comments
 (0)