Skip to content

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

fix: add rate limit for SMTP settings

Jonathan Summers-Muir17ba03f7601c
diff --git a/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx b/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx
index 3f2c9b34b8f..45c21a08027 100644
--- a/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx
+++ b/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsx
@@ -244,6 +244,15 @@ const SmtpForm = () => {
labelOptional="In seconds"
descriptionText="How long between each email can a new email be sent via your SMTP server."
/>
+ <Input
+ type="number"
+ name="RATE_LIMIT_EMAIL_SENT"
+ id="RATE_LIMIT_EMAIL_SENT"
+ min={0}
+ label="Rate limit for sending emails"
+ descriptionText="How many emails can be sent per hour."
+ actions={<span className="text-scale-900 mr-3">per hour</span>}
+ />
<Input
name="SMTP_USER"
id="SMTP_USER"
diff --git a/studio/components/interfaces/Auth/SmtpForm/SmtpForm.utils.ts b/studio/components/interfaces/Auth/SmtpForm/SmtpForm.utils.ts
index 2dc008d8eac..35bb8f83a61 100644
--- a/studio/components/interfaces/Auth/SmtpForm/SmtpForm.utils.ts
+++ b/studio/components/interfaces/Auth/SmtpForm/SmtpForm.utils.ts
@@ -27,5 +27,6 @@ export const generateFormValues = (config?: Partial<AuthConfig>): Partial<AuthCo
SMTP_PASS: config?.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,
}
}