diff options
| author | Joe Carstairs <me@joeac.net> | 2026-01-24 10:08:45 +0000 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-01-24 10:08:45 +0000 |
| commit | 9c9b20a38a51da764d4f99091a06ffc4085ce58f (patch) | |
| tree | 342f5813254cf3acd1013d153d2d71444a7619ee /website/src/actions/otp/send-otp.ts | |
| parent | 1ab35815d76af3b16d8d94eac39a0e979bc58b20 (diff) | |
Stop sending emails at max, not after max
Diffstat (limited to 'website/src/actions/otp/send-otp.ts')
| -rw-r--r-- | website/src/actions/otp/send-otp.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/website/src/actions/otp/send-otp.ts b/website/src/actions/otp/send-otp.ts index 67df483..2022990 100644 --- a/website/src/actions/otp/send-otp.ts +++ b/website/src/actions/otp/send-otp.ts @@ -28,7 +28,7 @@ async function sendOtp({ email, name }: OtpParams) { SentEmails, gte(SentEmails.sentAt, Date.now() - 1000 * 60 * 60 * 24), ); - if (emailsSentLast24Hours > MAX_DAILY_EMAILS) { + if (emailsSentLast24Hours >= MAX_DAILY_EMAILS) { throw new Error( `${emailsSentLast24Hours} emails have been sent in the last 24 hours, but the max daily load is ${MAX_DAILY_EMAILS}.`, ); |
