diff --git a/apps/studio/components/interfaces/Auth/RateLimits/RateLimits.tsx b/apps/studio/components/interfaces/Auth/RateLimits/RateLimits.tsx index d596e6243f0..ae09d21f0cc 100644 --- a/apps/studio/components/interfaces/Auth/RateLimits/RateLimits.tsx +++ b/apps/studio/components/interfaces/Auth/RateLimits/RateLimits.tsx @@ -22,6 +22,7 @@ import { Alert_Shadcn_, Button, FormControl_Shadcn_, + FormDescription_Shadcn_, FormField_Shadcn_, FormItem_Shadcn_, Form_Shadcn_, @@ -76,6 +77,10 @@ const RateLimits = () => { .number() .min(0, 'Must be not be lower than 0') .max(32767, 'Must not be more than 32,767 an hour'), + RATE_LIMIT_OTP: z.coerce + .number() + .min(0, 'Must be not be lower than 0') + .max(32767, 'Must not be more than 32,767 an hour'), }) const form = useForm>({ @@ -85,6 +90,7 @@ const RateLimits = () => { RATE_LIMIT_VERIFY: 0, RATE_LIMIT_EMAIL_SENT: 0, RATE_LIMIT_SMS_SENT: 0, + RATE_LIMIT_OTP: 0, }, }) @@ -98,6 +104,7 @@ const RateLimits = () => { 'RATE_LIMIT_EMAIL_SENT', 'RATE_LIMIT_SMS_SENT', 'RATE_LIMIT_ANONYMOUS_USERS', + 'RATE_LIMIT_OTP', ] as (keyof typeof payload)[] params.forEach((param) => { if (data[param] !== authConfig?.[param]) payload[param] = data[param] @@ -114,6 +121,7 @@ const RateLimits = () => { RATE_LIMIT_EMAIL_SENT: authConfig.RATE_LIMIT_EMAIL_SENT, RATE_LIMIT_SMS_SENT: authConfig.RATE_LIMIT_SMS_SENT, RATE_LIMIT_ANONYMOUS_USERS: authConfig.RATE_LIMIT_ANONYMOUS_USERS, + RATE_LIMIT_OTP: authConfig.RATE_LIMIT_OTP, }) } // eslint-disable-next-line react-hooks/exhaustive-deps @@ -394,6 +402,40 @@ const RateLimits = () => { /> + + Number of sign up and sign-in requests that can be made per hour per IP + address (excludes anonymous users). +

+ } + > + Rate limit for sign ups and sign ins + + } + > + + ( + + + + + {field.value > 0 && ( + + This is equivalent to {field.value * 12} requests per hour + + )} + + )} + /> + +