make all emails lowercase closes #89

This commit is contained in:
Milo Schwartz
2025-01-21 18:36:50 -05:00
parent d1278c252b
commit 5f92b0bbc1
10 changed files with 73 additions and 15 deletions

View File

@@ -24,7 +24,10 @@ import logger from "@server/logger";
const authWithWhitelistBodySchema = z
.object({
email: z.string().email(),
email: z
.string()
.email()
.transform((v) => v.toLowerCase()),
otp: z.string().optional()
})
.strict();

View File

@@ -11,7 +11,10 @@ import { and, eq } from "drizzle-orm";
const setResourceWhitelistBodySchema = z
.object({
emails: z.array(z.string().email()).max(50)
emails: z
.array(z.string().email())
.max(50)
.transform((v) => v.map((e) => e.toLowerCase()))
})
.strict();