Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
misc: migrated to native DAL method
Sheen Capadngan3639a7fc18c5
diff --git a/backend/src/services/auth/auth-login-service.ts b/backend/src/services/auth/auth-login-service.tsindex a97e941451..cbf43b2454 100644--- a/backend/src/services/auth/auth-login-service.ts+++ b/backend/src/services/auth/auth-login-service.ts@@ -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");diff --git a/backend/src/services/user/user-dal.ts b/backend/src/services/user/user-dal.tsindex 7c73fc4f4a..f2da0df0e2 100644--- a/backend/src/services/user/user-dal.ts+++ b/backend/src/services/user/user-dal.ts@@ -143,19 +143,6 @@ export const userDALFactory = (db: TDbClient) => {}};- const incrementFailedMfaAttempt = async (userId: string, tx?: Knex) => {- try {- const [user] = await (tx || db)(TableName.Users)- .where("id", userId)- .increment("consecutiveFailedMfaAttempts", 1)- .returning("*");-- return user;- } catch (error) {- throw new DatabaseError({ error, name: "Increment Failed MFA Attempt" });- }- };-return {...userOrm,findUserByUsername,@@ -168,7 +155,6 @@ export const userDALFactory = (db: TDbClient) => {upsertUserEncryptionKey,createUserEncryption,findOneUserAction,- createUserAction,- incrementFailedMfaAttempt+ createUserAction};};