aboutsummaryrefslogtreecommitdiffstats
path: root/settings/src/components/AdminTwoFactor.vue
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-02-28 13:32:26 +0100
committerGitHub <noreply@github.com>2019-02-28 13:32:26 +0100
commita43ffc7dec1e34e4c1159877ee3ff3a438de2b28 (patch)
treec50728aa940be200608c63cface55b0109c3419c /settings/src/components/AdminTwoFactor.vue
parent8dc83e19445b236ccc7ac02878c82fd300f7e573 (diff)
parentc621da4fd682990af1520e0313dd763c621b041f (diff)
downloadnextcloud-server-a43ffc7dec1e34e4c1159877ee3ff3a438de2b28.tar.gz
nextcloud-server-a43ffc7dec1e34e4c1159877ee3ff3a438de2b28.zip
Merge pull request #13489 from nextcloud/enh/settings/2fa-security-store
Do not load 2fa admin settings async
Diffstat (limited to 'settings/src/components/AdminTwoFactor.vue')
-rw-r--r--settings/src/components/AdminTwoFactor.vue33
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) {