made the email field case-insensitive

This commit is contained in:
Daniel
2023-07-04 00:13:53 +03:30
parent ae1682ad55
commit ddc0675d2e
9 changed files with 19 additions and 15 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ export default async function getUser(
) {
const user = await prisma.user.findUnique({
where: {
email: lookupEmail,
email: lookupEmail.toLowerCase(),
},
});
@@ -16,7 +16,7 @@ export default async function getUser(
if (
!isSelf &&
user?.isPrivate &&
!user.whitelistedUsers.includes(userEmail)
!user.whitelistedUsers.includes(userEmail.toLowerCase())
) {
return { response: "This profile is private.", status: 401 };
}