misc: migrated to native DAL method

This commit is contained in:
Sheen Capadngan
2024-05-27 11:01:22 +08:00
parent 59c8dc3cda
commit 3639a7fc18
2 changed files with 2 additions and 16 deletions
@@ -314,7 +314,7 @@ export const authLoginServiceFactory = ({
try {
const updatedUser = await userDAL.transaction(async (tx) => {
const PROGRESSIVE_DELAY_INTERVAL = 3;
const user = await userDAL.incrementFailedMfaAttempt(userId, tx);
const user = await userDAL.updateById(userId, { $incr: { consecutiveFailedMfaAttempts: 1 } }, tx);
if (!user) {
throw new Error("User not found");