summaryrefslogtreecommitdiffstats
path: root/settings/src
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-03-01 14:09:54 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-03-01 21:24:44 +0100
commit102f700d96556424e4b59fcc9fadd65c1a377225 (patch)
treebdd172ea009b5869960a78145d0d49489cae899f /settings/src
parent2398d1183e7e561c8d3db7c06d8919d09c26b9e8 (diff)
downloadnextcloud-server-102f700d96556424e4b59fcc9fadd65c1a377225.tar.gz
nextcloud-server-102f700d96556424e4b59fcc9fadd65c1a377225.zip
Load auth tokens with the initial state API
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'settings/src')
-rw-r--r--settings/src/components/AuthTokenList.vue6
-rw-r--r--settings/src/components/AuthTokenSection.vue23
-rw-r--r--settings/src/main-personal-security.js6
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');