diff --git a/dashboard/public/translation/en.json b/dashboard/public/translation/en.json index 311067f69..ef0e73f8f 100644 --- a/dashboard/public/translation/en.json +++ b/dashboard/public/translation/en.json @@ -46,7 +46,8 @@ "add": "Add", "next": "Next", "configure": "Configure", - "restart": "Restart" + "restart": "Restart", + "reset": "Reset" }, "rebootDialog": { "title": "Reboot Server", @@ -255,7 +256,11 @@ "title": "LDAP Server", "enabled": "Enable LDAP server" }, - "title": "Users" + "title": "Users", + "2FAResetDialog": { + "title": "Reset 2FA", + "description": "Remove the existing 2FA setup for user “{{ username }}”?" + } }, "profile": { "title": "Profile", diff --git a/dashboard/src/components/UserDialog.vue b/dashboard/src/components/UserDialog.vue index ca61662ff..063920ae7 100644 --- a/dashboard/src/components/UserDialog.vue +++ b/dashboard/src/components/UserDialog.vue @@ -32,7 +32,6 @@ const roles = ref([]); const profile = ref({}); const busy = ref(false); const profileLocked = ref(false); -const external2FA = ref(false); const formError = ref({}); const displayName = ref(''); const email = ref(''); @@ -46,19 +45,6 @@ const allLocalGroups = ref([]); const active = ref(true); const sendInvite = ref(false); const isSelf = ref(false); -const reset2FABusy = ref(false); - -async function onReset2FA() { - if (!user.value) return; - - reset2FABusy.value = true; - - const [error] = await usersModel.disableTwoFactorAuthentication(user.value.id); - if (error) return console.error(error); - - user.value.twoFactorAuthenticationEnabled = false; - reset2FABusy.value = false; -} let avatarFile = 'src'; function onAvatarChanged(file) { @@ -220,7 +206,6 @@ defineExpose({ [error, result] = await dashboardModel.config(); if (error) return console.error(error); profileLocked.value = result.profileLocked; - external2FA.value = result.external2FA; imagePicker.value.reset(); dialog.value.open(); @@ -238,10 +223,6 @@ defineExpose({ reject-style="secondary" :reject-label="$t('main.dialog.cancel')" :reject-active="!busy" - alternate-style="secondary" - :alternate-label="(user && user.twoFactorAuthenticationEnabled && !(user.source && external2FA)) ? $t('users.passwordResetDialog.reset2FAAction') : null" - :alternate-busy="reset2FABusy" - @alternate="onReset2FA()" @confirm="onSubmit()" >