fix(2FA): mark OTP used in transaction
This commit is contained in:
1 parent
4b15f2ad7c
commit
330c2237f9
1 file changed
+1
-1
@@ -69,9 +69,9 @@ export async function POST(request: Request) {
|
|||||||
await tx.twoFactorBackupCode.createMany({
|
await tx.twoFactorBackupCode.createMany({
|
||||||
data: hashed.map(codeHash => ({ userId, codeHash })),
|
data: hashed.map(codeHash => ({ userId, codeHash })),
|
||||||
});
|
});
|
||||||
|
await markOtpUsed(userId, token, tx);
|
||||||
});
|
});
|
||||||
|
|
||||||
await markOtpUsed(userId, token);
|
|
||||||
await resetRateLimit(userId);
|
await resetRateLimit(userId);
|
||||||
|
|
||||||
return json({ backupCodes: plaintext });
|
return json({ backupCodes: plaintext });
|
||||||
|
|||||||
Reference in new issue
Block a user