feat: Email addresses are not case sensitive

This commit is contained in:
beilunyang
2025-01-17 21:58:27 +08:00
parent 5df270a471
commit 1bc0369b83
2 changed files with 3 additions and 3 deletions

View File

@@ -57,7 +57,7 @@ export async function POST(request: Request) {
const address = `${name || nanoid(8)}@${domain}`
const existingEmail = await db.query.emails.findFirst({
where: eq(emails.address, address)
where: eq(sql`LOWER(${emails.address})`, address.toLowerCase())
})
if (existingEmail) {