Skip to content

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

feat: resolved passkey popping up

=6316fb42ea14
diff --git a/backend/src/services/auth/auth-login-service.ts b/backend/src/services/auth/auth-login-service.ts
index bd159cd3db..1ff0e5cdf6 100644
--- a/backend/src/services/auth/auth-login-service.ts
+++ b/backend/src/services/auth/auth-login-service.ts
@@ -1333,9 +1333,10 @@ export const authLoginServiceFactory = ({
// Check MFA before issuing tokens — mirrors the logic in selectOrganization
const user = await userDAL.findById(userEnc.userId);
const org = organizationId ? await orgDAL.findById(organizationId) : null;
- const shouldCheckMfa = org?.enforceMfa || user.isMfaEnabled;
+ // for now check mfa in this state when your token is org scoped. If not we will do it in select org step
+ const shouldCheckMfa = org?.enforceMfa || user?.isMfaEnabled;
- if (shouldCheckMfa) {
+ if (shouldCheckMfa && organizationId) {
enforceUserLockStatus(Boolean(user.isLocked), user.temporaryLockDateEnd);
const orgMfaMethod = org?.enforceMfa ? (org.selectedMfaMethod ?? MfaMethod.EMAIL) : undefined;
diff --git a/frontend/src/hooks/api/users/queries.tsx b/frontend/src/hooks/api/users/queries.tsx
index 88c52ed058..2d9968a947 100644
--- a/frontend/src/hooks/api/users/queries.tsx
+++ b/frontend/src/hooks/api/users/queries.tsx
@@ -338,7 +338,7 @@ export const clearSession = (keepQueryClient?: boolean) => {
sessionStorage.removeItem(SessionStorageKeys.CLI_TERMINAL_TOKEN);
if (!keepQueryClient) {
- qc.invalidateQueries();
+ qc.clear();
}
};