Files
SuhailandGitHub 0e8fa08646 feat(2FA): enforce 2fa team wide (#2138)
* feat(2FA): enforce 2fa team wide

* fix: proper type for prop

* fix: show team id in alert

* refactor: use single method for closing modal
2024-09-05 22:45:20 +05:30

49 lines
774 B
Vue

<template>
<Dialog
v-model="show"
:options="{
title: is2FAEnabled
? 'Disable Two-Factor Authentication'
: 'Enable Two-Factor Authentication'
}"
>
<template #body-content>
<Configure2FA @enabled="closeDialog" @disabled="closeDialog" />
</template>
</Dialog>
</template>
<script>
import Configure2FA from '../../auth/Configure2FA.vue';
export default {
props: {
modelValue: {
type: Boolean,
required: true
}
},
components: {
Configure2FA
},
methods: {
closeDialog() {
this.show = false;
}
},
computed: {
is2FAEnabled() {
return this.$team.doc?.user_info?.is_2fa_enabled;
},
show: {
get() {
return this.modelValue;
},
set(value) {
this.$emit('update:modelValue', value);
}
}
}
};
</script>