This commit is contained in:
PxlLoewe
2025-06-26 01:46:44 -07:00
parent ed4a57f42d
commit 8968bff1c5
4 changed files with 11 additions and 6 deletions

View File

@@ -20,8 +20,13 @@ export const options: AuthOptions = {
where: { email: credentials.email },
});
const v1User = (oldUser as OldUser[]).find((u) => u.email === credentials.email);
console.log("V1 User", v1User?.publicId);
if (!user && v1User) {
if (bcrypt.compareSync(credentials.password, v1User.password)) {
console.log(
"v1 User Passwords match:",
bcrypt.compareSync(credentials.password, v1User.password),
);
const newUser = await prisma.user.create({
data: {
email: v1User.email,
@@ -74,6 +79,7 @@ export const options: AuthOptions = {
}
return null;
} catch (error) {
console.error("Error during authorization:", error);
return null;
}
},