bug fixed

This commit is contained in:
daniel31x13
2023-10-23 01:45:31 -04:00
parent 565ee92d20
commit bcae97a296
2 changed files with 30 additions and 7 deletions
+4 -4
View File
@@ -54,10 +54,10 @@ export default async function postUser(
const checkIfUserExists = await prisma.user.findFirst({
where: emailEnabled
? {
email: body.email?.toLowerCase(),
email: body.email?.toLowerCase().trim(),
}
: {
username: (body.username as string).toLowerCase(),
username: (body.username as string).toLowerCase().trim(),
},
});
@@ -71,8 +71,8 @@ export default async function postUser(
name: body.name,
username: emailEnabled
? undefined
: (body.username as string).toLowerCase(),
email: emailEnabled ? body.email?.toLowerCase() : undefined,
: (body.username as string).toLowerCase().trim(),
email: emailEnabled ? body.email?.toLowerCase().trim() : undefined,
password: hashedPassword,
},
});