Build fixes, email preview system

This commit is contained in:
2025-07-29 19:45:38 -04:00
parent e6791f8cb8
commit 9370d5c935
78 changed files with 5798 additions and 10397 deletions
+11 -5
View File
@@ -47,13 +47,16 @@ export const authConfig = {
name: "credentials",
credentials: {
email: { label: "Email", type: "email" },
password: { label: "Password", type: "password" }
password: { label: "Password", type: "password" },
},
async authorize(credentials) {
if (!credentials?.email || !credentials?.password) {
return null;
}
if (typeof credentials.email !== 'string' || typeof credentials.password !== 'string') {
if (
typeof credentials.email !== "string" ||
typeof credentials.password !== "string"
) {
return null;
}
@@ -61,11 +64,14 @@ export const authConfig = {
where: eq(users.email, credentials.email),
});
if (!user || !user.password) {
if (!user?.password) {
return null;
}
const isPasswordValid = await bcrypt.compare(credentials.password, user.password);
const isPasswordValid = await bcrypt.compare(
credentials.password,
user.password,
);
if (!isPasswordValid) {
return null;
@@ -76,7 +82,7 @@ export const authConfig = {
email: user.email,
name: user.name,
};
}
},
}),
],
adapter: DrizzleAdapter(db, {