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
remove dead code
Thiago Araujo da Silva1a7062b5078e
diff --git a/backend/src/services/auth/auth-login-service.ts b/backend/src/services/auth/auth-login-service.tsindex 1e0aef74bb..4e6a4a7793 100644--- a/backend/src/services/auth/auth-login-service.ts+++ b/backend/src/services/auth/auth-login-service.ts@@ -174,15 +174,13 @@ export const authLoginServiceFactory = ({email,authMethod,organizationId,- requiredMfaMethod,- sendEmailCode = true+ requiredMfaMethod}: {userId: string;email?: string | null;authMethod: AuthMethod;organizationId?: string;requiredMfaMethod: MfaMethod;- sendEmailCode?: boolean;}) => {const appCfg = getConfig();@@ -199,7 +197,7 @@ export const authLoginServiceFactory = ({{ expiresIn: appCfg.JWT_MFA_LIFETIME });- if (requiredMfaMethod === MfaMethod.EMAIL && email && sendEmailCode) {+ if (requiredMfaMethod === MfaMethod.EMAIL && email) {await sendUserMfaCode({ userId, email });}@@ -1300,8 +1298,7 @@ export const authLoginServiceFactory = ({email: user.email,authMethod: userAuthMethod,requiredMfaMethod,- organizationId: rootOrg.id,- sendEmailCode: true+ organizationId: rootOrg.id});return { isMfaEnabled: true, mfa: mfaToken, mfaMethod: requiredMfaMethod } as const;diff --git a/backend/src/services/auth/mfa-lockout-service.ts b/backend/src/services/auth/mfa-lockout-service.tsindex 331370c780..8d51425a73 100644--- a/backend/src/services/auth/mfa-lockout-service.ts+++ b/backend/src/services/auth/mfa-lockout-service.ts@@ -7,15 +7,13 @@ import { TokenType } from "@app/services/auth-token/auth-token-types";import { SmtpTemplates, TSmtpService } from "@app/services/smtp/smtp-service";import { TUserDALFactory } from "@app/services/user/user-dal";-import { enforceUserLockStatus } from "./auth-fns";-const PROGRESSIVE_DELAY_INTERVAL = 5;const PROGRESSIVE_DELAYS_IN_MINS = [5, 30, 60];const STEP_UP_MFA_MAX_ATTEMPTS = 5;type TMfaLockoutServiceFactoryDep = {- userDAL: Pick<TUserDALFactory, "findById" | "updateById" | "transaction">;+ userDAL: Pick<TUserDALFactory, "updateById" | "transaction">;tokenService: Pick<TAuthTokenServiceFactory, "createTokenForUser">;smtpService: Pick<TSmtpService, "sendMail">;keyStore: Pick<@@ -32,15 +30,6 @@ export const mfaLockoutServiceFactory = ({smtpService,keyStore}: TMfaLockoutServiceFactoryDep) => {- // Rejects the request when the user is currently locked (permanently or- // temporarily) from MFA verification. Fetches the user itself so callers that- // don't already hold the row can guard cheaply.- const enforceMfaLockStatus = async (userId: string) => {- const user = await userDAL.findById(userId);- if (!user) return;- enforceUserLockStatus(Boolean(user.isLocked), user.temporaryLockDateEnd);- };-// Increments the shared consecutive-failed-MFA counter and, on hitting a// progressive-delay interval, applies an escalating temporary lock; once the// delays are exhausted the account is permanently locked. Returns the updated@@ -205,7 +194,6 @@ export const mfaLockoutServiceFactory = ({};return {- enforceMfaLockStatus,handleFailedMfaAttempt,resetMfaLockStatus,enforceStepUpMfaLockStatus,