summary refs log tree commit diff
path: root/src/api/routes/auth/mfa/totp.ts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/api/routes/auth/mfa/totp.ts (renamed from api/src/routes/auth/mfa/totp.ts)9
1 files changed, 8 insertions, 1 deletions
diff --git a/api/src/routes/auth/mfa/totp.ts b/src/api/routes/auth/mfa/totp.ts

index cec6e5ee..50b9e9c8 100644 --- a/api/src/routes/auth/mfa/totp.ts +++ b/src/api/routes/auth/mfa/totp.ts
@@ -26,7 +26,14 @@ router.post("/", route({ body: "TotpSchema" }), async (req: Request, res: Respon ], }); - const backup = await BackupCode.findOne({ code: code, expired: false, consumed: false, user: { id: user.id }}); + const backup = await BackupCode.findOne({ + where: { + code: code, + expired: false, + consumed: false, + user: { id: user.id } + } + }); if (!backup) { const ret = verifyToken(user.totp_secret!, code);