Skip to content

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

feat: more claude review

=6772aa884b94
diff --git a/backend/src/services/auth-token/auth-token-service.ts b/backend/src/services/auth-token/auth-token-service.ts
index a427ef61e2..e123062534 100644
--- a/backend/src/services/auth-token/auth-token-service.ts
+++ b/backend/src/services/auth-token/auth-token-service.ts
@@ -234,15 +234,15 @@ export const tokenServiceFactory = ({ tokenDAL, userDAL, orgDAL, keyStore }: TAu
const appCfg = getConfig();
const oldRefreshVersion = tokenVersion.refreshVersion;
+ // Store grace entry in Redis so the old token is still accepted briefly
+ const graceKey = KeyStorePrefixes.RefreshTokenGrace(tokenVersion.id);
+ await keyStore.setItemWithExpiry(graceKey, KeyStoreTtls.RefreshTokenGraceInSeconds, String(oldRefreshVersion));
+
// Increment refreshVersion in DB
const updatedSession = await tokenDAL.incrementRefreshVersion(tokenVersion.id, decodedToken.userId);
if (!updatedSession)
throw new UnauthorizedError({ message: "Failed to rotate refresh token", name: "RotationFailed" });
- // Store grace entry in Redis so the old token is still accepted briefly
- const graceKey = KeyStorePrefixes.RefreshTokenGrace(tokenVersion.id);
- await keyStore.setItemWithExpiry(graceKey, KeyStoreTtls.RefreshTokenGraceInSeconds, String(oldRefreshVersion));
-
// Determine refresh token expiry
let refreshTokenExpiresIn: string | number = appCfg.JWT_REFRESH_LIFETIME;
if (decodedToken.organizationId) {
diff --git a/backend/src/services/auth/auth-login-type.ts b/backend/src/services/auth/auth-login-type.ts
index 0c8c1c97c2..29b58c6a32 100644
--- a/backend/src/services/auth/auth-login-type.ts
+++ b/backend/src/services/auth/auth-login-type.ts
@@ -59,5 +59,4 @@ export type TProcessProviderCallbackDTO = {
export type TProviderAuthResult =
| { result: ProviderAuthResult.SESSION; tokens: { access: string; refresh: string }; callbackPort?: number }
- | { result: ProviderAuthResult.MFA_REQUIRED; mfaToken: string; mfaMethod: MfaMethod; callbackPort?: number }
| { result: ProviderAuthResult.SIGNUP_REQUIRED; signupToken: string; callbackPort?: number };
diff --git a/backend/src/services/auth/auth-type.ts b/backend/src/services/auth/auth-type.ts
index efea56c4dd..3c1e2f83ed 100644
--- a/backend/src/services/auth/auth-type.ts
+++ b/backend/src/services/auth/auth-type.ts
@@ -28,8 +28,6 @@ export enum AuthTokenType {
export enum ProviderAuthResult {
// User is fully authenticated — set refresh cookie and redirect to app
SESSION = "session",
- // User needs MFA verification (org-scoped IdP flows: SAML/OIDC/LDAP)
- MFA_REQUIRED = "mfa_required",
// User account is incomplete (new user or unverified alias) — issue signup token
SIGNUP_REQUIRED = "signup_required"
}