This commit is contained in:
cirroskais 2024-04-23 08:04:12 -04:00
parent 393312dba4
commit 3331779499
No known key found for this signature in database
GPG key ID: 36FBC361DF481862

View file

@ -37,11 +37,12 @@ export async function createSession(userId, needsMfa = false) {
} }
export async function findUser({ email, username }) { export async function findUser({ email, username }) {
if (!email || !username) return false; if (!email && !username) return false;
const user = await prisma.user.findFirst({ const user = await prisma.user.findFirst({
where: { where: {
OR: [email, username] email,
username
} }
}); });