Hide totp settings if it is disabled server side

This commit is contained in:
kolaente 2020-05-29 18:49:50 +02:00
parent bc603605a7
commit c3ba068dd7
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 8 additions and 1 deletions

View File

@ -75,7 +75,7 @@
</div>
</div>
</div>
<div class="card">
<div class="card" v-if="totpEnabled">
<header class="card-header">
<p class="card-header-title">
Two Factor Authentication
@ -132,6 +132,8 @@
import TotpModel from '../../models/totp'
import TotpService from '../../services/totp'
import {mapState} from 'vuex'
export default {
name: 'Settings',
data() {
@ -177,6 +179,9 @@
this.error(e, this)
})
},
computed: mapState({
totpEnabled: state => state.config.totpEnabled
}),
methods: {
updatePassword() {
if (this.passwordConfirm !== this.passwordUpdate.newPassword) {

View File

@ -13,6 +13,7 @@ export default {
registrationEnabled: true,
availableMigrators: [],
taskAttachmentsEnabled: true,
totpEnabled: true,
}),
mutations: {
[CONFIG](state, config) {
@ -24,6 +25,7 @@ export default {
state.registrationEnabled = config.registration_enabled
state.availableMigrators = config.available_migrators
state.taskAttachmentsEnabled = config.task_attachments_enabled
state.totpEnabled = config.totp_enabled
},
},
actions: {