fix: always lowercase user email

This commit is contained in:
vas3k
2025-05-22 17:11:33 +02:00
parent 3976db1114
commit c0966ab327
2 changed files with 6 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ export const getOrCreateSelfHostedUser = cache(async () => {
export function getOrCreateCloudUser(email: string, data: Prisma.UserCreateInput) {
return prisma.user.upsert({
where: { email },
where: { email: email.toLowerCase() },
update: data,
create: data,
})
@@ -42,7 +42,7 @@ export const getUserById = cache(async (id: string) => {
export const getUserByEmail = cache(async (email: string) => {
return await prisma.user.findUnique({
where: { email },
where: { email: email.toLowerCase() },
})
})