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

View File

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