Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: always allow to enable require 2fa in workspace level (#7010)

boojacka28aa14485cf
diff --git a/frontend/src/components/GeneralSetting/SecuritySetting.vue b/frontend/src/components/GeneralSetting/SecuritySetting.vue
index dc7d890de6..163a32a1d3 100644
--- a/frontend/src/components/GeneralSetting/SecuritySetting.vue
+++ b/frontend/src/components/GeneralSetting/SecuritySetting.vue
@@ -107,13 +107,10 @@ import {
pushNotification,
useCurrentUserV1,
useActuatorV1Store,
- useUserStore,
} from "@/store";
import { hasWorkspacePermissionV1 } from "@/utils";
import { useI18n } from "vue-i18n";
import { FeatureType } from "@/types";
-import { UserType } from "@/types/proto/v1/auth_service";
-import { State } from "@/types/proto/v1/common";
import { useSettingV1Store } from "@/store/modules/v1/setting";
interface LocalState {
@@ -123,7 +120,6 @@ const state = reactive<LocalState>({});
const { t } = useI18n();
const settingV1Store = useSettingV1Store();
const currentUserV1 = useCurrentUserV1();
-const userStore = useUserStore();
const actuatorStore = useActuatorV1Store();
const { isSaaSMode } = storeToRefs(actuatorStore);
@@ -171,29 +167,6 @@ const handleRequire2FAToggle = async (on: boolean) => {
return;
}
- if (on) {
- // Only allow to enable this when all users have enabled 2FA.
- const userList = (await userStore.fetchUserList())
- .filter(
- (user) => user.userType === UserType.USER && user.state === State.ACTIVE
- )
- .filter((user) => !user.mfaEnabled);
- if (userList.length > 0) {
- pushNotification({
- module: "bytebase",
- style: "WARN",
- title: t(
- "settings.general.workspace.require-2fa.need-all-user-2fa-enabled",
- {
- count: userList.length,
- users: userList.map((user) => user.email).join(", "),
- }
- ),
- });
- return;
- }
- }
-
await settingV1Store.updateWorkspaceProfile({
require2fa: on,
});