diff options
Diffstat (limited to 'settings/src/components/AdminTwoFactor.vue')
-rw-r--r-- | settings/src/components/AdminTwoFactor.vue | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/settings/src/components/AdminTwoFactor.vue b/settings/src/components/AdminTwoFactor.vue index 5feaa75af21..0a20bf1b9e3 100644 --- a/settings/src/components/AdminTwoFactor.vue +++ b/settings/src/components/AdminTwoFactor.vue @@ -77,33 +77,24 @@ }, data () { return { - state: { - enforced: false, - enforcedGroups: [], - excludedGroups: [], - }, loading: false, groups: [], loadingGroups: false, } }, + computed: { + state: function() { + return { + enforced: this.$store.state.enforced, + enforcedGroups: this.$store.state.enforcedGroups, + excludedGroups: this.$store.state.excludedGroups, + } + } + }, mounted () { - this.loading = true - Axios.get(OC.generateUrl('/settings/api/admin/twofactorauth')) - .then(resp => resp.data) - .then(state => { - this.state = state - - // Groups are loaded dynamically, but the assigned ones *should* - // be valid groups, so let's add them as initial state - this.groups = _.sortedUniq(this.state.enforcedGroups.concat(this.state.excludedGroups)) - - this.loading = false - }) - .catch(err => { - console.error('Could not load two-factor state', err) - throw err - }) + // Groups are loaded dynamically, but the assigned ones *should* + // be valid groups, so let's add them as initial state + this.groups = _.sortedUniq(this.state.enforcedGroups.concat(this.state.excludedGroups)) }, methods: { searchGroup: _.debounce(function (query) { |