mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-03 17:44:44 +02:00
setup react email and nodemailer
This commit is contained in:
parent
c9d98a8e8c
commit
57ebc0e525
11 changed files with 2497 additions and 4754 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue