diff options
Diffstat (limited to 'settings/src')
-rw-r--r-- | settings/src/components/AuthTokenList.vue | 6 | ||||
-rw-r--r-- | settings/src/components/AuthTokenSection.vue | 23 | ||||
-rw-r--r-- | settings/src/main-personal-security.js | 6 |
3 files changed, 12 insertions, 23 deletions
diff --git a/settings/src/components/AuthTokenList.vue b/settings/src/components/AuthTokenList.vue index fe92852921c..1c83488ed19 100644 --- a/settings/src/components/AuthTokenList.vue +++ b/settings/src/components/AuthTokenList.vue @@ -20,7 +20,7 @@ --> <template> - <table id="app-tokens-table" :class="{ 'icon-loading' : loading }"> + <table id="app-tokens-table"> <thead v-if="tokens.length"> <tr> <th></th> @@ -52,10 +52,6 @@ tokens: { type: Array, required: true, - }, - loading: { - type: Boolean, - required: true, } }, computed: { diff --git a/settings/src/components/AuthTokenSection.vue b/settings/src/components/AuthTokenSection.vue index e5be46fba15..6d70059abd6 100644 --- a/settings/src/components/AuthTokenSection.vue +++ b/settings/src/components/AuthTokenSection.vue @@ -24,7 +24,6 @@ <h2>{{ t('settings', 'Devices & sessions') }}</h2> <p class="settings-hint hidden-when-empty">{{ t('settings', 'Web, desktop and mobile clients currently logged in to your account.') }}</p> <AuthTokenList :tokens="tokens" - :loading="loading" @toggleScope="toggleTokenScope" @rename="rename" @delete="deleteToken"/> @@ -48,31 +47,21 @@ export default { name: "AuthTokenSection", + props: { + tokens: { + type: Array, + requried: true, + }, + }, components: { AuthTokenSetupDialogue, AuthTokenList }, data() { return { - loading: true, baseUrl: OC.generateUrl('/settings/personal/authtokens'), - tokens: [], } }, - mounted() { - Axios.get(this.baseUrl) - .then(resp => resp.data) - .then(tokens => { - console.debug('loaded app tokens', tokens); - this.loading = false; - this.tokens = tokens; - }) - .catch(err => { - OC.Notification.showTemporary(t('core', 'Error while loading browser sessions and device tokens')); - console.error('could not load app tokens', err); - throw err; - }); - }, methods: { addNewToken (name) { console.debug('creating a new app token', name); diff --git a/settings/src/main-personal-security.js b/settings/src/main-personal-security.js index 5b481a843ff..aaddd0a3332 100644 --- a/settings/src/main-personal-security.js +++ b/settings/src/main-personal-security.js @@ -32,4 +32,8 @@ Vue.use(VTooltip); Vue.prototype.t = t; const View = Vue.extend(AuthTokenSection); -new View().$mount('#security'); +new View({ + propsData: { + tokens: OCP.InitialState.loadState('settings', 'app_tokens'), + } +}).$mount('#security'); |