setup react email and nodemailer

This commit is contained in:
Milo Schwartz 2024-10-03 20:55:54 -04:00
parent c9d98a8e8c
commit 57ebc0e525
No known key found for this signature in database
11 changed files with 2497 additions and 4754 deletions

View file

@ -5,10 +5,9 @@ import { fromError } from "zod-validation-error";
import { decodeHex } from "oslo/encoding";
import { TOTPController } from "oslo/otp";
import HttpCode from "@server/types/HttpCode";
import { verifySession, unauthorized } from "@server/auth";
import { response } from "@server/utils";
import { db } from "@server/db";
import { users } from "@server/db/schema";
import { User, users } from "@server/db/schema";
import { eq } from "drizzle-orm";
export const verifyTotpBody = z.object({
@ -39,10 +38,7 @@ export async function verifyTotp(
const { code } = parsedBody.data;
const { session, user } = await verifySession(req);
if (!session) {
return next(unauthorized());
}
const user = req.user as User;
if (user.twoFactorEnabled) {
return next(