Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix(auth-login-service): log error when failing to send MFA unlock email due to lock contention

Victor Santosb23a7ff2098b
diff --git a/backend/src/services/auth/auth-login-service.ts b/backend/src/services/auth/auth-login-service.ts
index 64ce7bc883..65b2478ffb 100644
--- a/backend/src/services/auth/auth-login-service.ts
+++ b/backend/src/services/auth/auth-login-service.ts
@@ -930,8 +930,10 @@ export const authLoginServiceFactory = ({
// Mark that an unlock email was sent, expires after 5 minutes
await keyStore.setItemWithExpiry(KeyStorePrefixes.UserMfaUnlockEmailSent(userId), 300, "1");
}
- } catch {
- // This is expected when another request is handling the email. The acquireLock will fail.
+ } catch (lockErr) {
+ if (lock) {
+ logger.error(lockErr, "Failed to send unlock email");
+ }
} finally {
if (lock) {
await lock.release();