fix(2FA): mark OTP used in transaction

This commit is contained in:
Rudy B. committed 2026-04-25 20:30:38 +02:00
1 parent 4b15f2ad7c
commit 330c2237f9
1 file changed
+1 -1
+1 -1
View File
@@ -69,9 +69,9 @@ export async function POST(request: Request) {
await tx.twoFactorBackupCode.createMany({
data: hashed.map(codeHash => ({ userId, codeHash })),
});
await markOtpUsed(userId, token, tx);
});
await markOtpUsed(userId, token);
await resetRateLimit(userId);
return json({ backupCodes: plaintext });