mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
feat(studio): set email rate limit to 30 when enabling custom SMTP (#40638)
This commit is contained in:
1 parent
d990ae840e
commit
a3ec8adeaa
2 files changed
+9
-2
No files matched your search
@@ -149,7 +149,15 @@ export const SmtpForm = () => {
|
||||
|
||||
const onSubmit = (values: SmtpFormValues) => {
|
||||
const { ENABLE_SMTP, ...rest } = values
|
||||
const payload = ENABLE_SMTP ? rest : defaultDisabledSmtpFormValues
|
||||
const basePayload = ENABLE_SMTP ? rest : defaultDisabledSmtpFormValues
|
||||
|
||||
// When enabling SMTP, set RATE_LIMIT_EMAIL_SENT to 30
|
||||
// When disabling, backend will handle resetting to default
|
||||
const isEnablingSmtp = ENABLE_SMTP && !isSmtpEnabled(authConfig)
|
||||
const payload = {
|
||||
...basePayload,
|
||||
...(isEnablingSmtp && { RATE_LIMIT_EMAIL_SENT: 30 }),
|
||||
}
|
||||
|
||||
// Format payload: Convert port to string
|
||||
if (payload.SMTP_PORT) {
|
||||
|
||||
@@ -27,6 +27,5 @@ export const generateFormValues = (config?: Partial<AuthConfig>): Partial<AuthCo
|
||||
SMTP_PASS: '',
|
||||
SMTP_PORT: config?.SMTP_PORT ?? '465',
|
||||
SMTP_MAX_FREQUENCY: config?.SMTP_MAX_FREQUENCY ?? 60,
|
||||
RATE_LIMIT_EMAIL_SENT: config?.RATE_LIMIT_EMAIL_SENT ?? 30,
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user