aboutsummaryrefslogtreecommitdiffstats
path: root/apps/oauth2/src/App.vue
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-12-07 13:57:50 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-12-07 13:57:50 +0100
commitc1f1dd18fc497a6dd456ceef19521e6d99b6752d (patch)
tree2fc4d308d4ca3aeaa12be27bfb7d818f02a22cf9 /apps/oauth2/src/App.vue
parent1f492322a8b83c8a5f5aba44058218316ed2908b (diff)
downloadnextcloud-server-c1f1dd18fc497a6dd456ceef19521e6d99b6752d.tar.gz
nextcloud-server-c1f1dd18fc497a6dd456ceef19521e6d99b6752d.zip
Switch to nextcloud-axios for oauth2 app
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/oauth2/src/App.vue')
-rw-r--r--apps/oauth2/src/App.vue19
1 files changed, 5 insertions, 14 deletions
diff --git a/apps/oauth2/src/App.vue b/apps/oauth2/src/App.vue
index c9c01fc11e0..036af6ca25f 100644
--- a/apps/oauth2/src/App.vue
+++ b/apps/oauth2/src/App.vue
@@ -54,7 +54,7 @@
</template>
<script>
-import axios from 'axios';
+import Axios from 'nextcloud-axios'
import OAuthItem from './components/OAuthItem';
export default {
@@ -74,36 +74,27 @@ export default {
};
},
beforeMount: function() {
- let requestToken = OC.requestToken;
- let tokenHeaders = { headers: { requesttoken: requestToken } };
-
- axios.get(OC.generateUrl('apps/oauth2/clients'), tokenHeaders)
+ Axios.get(OC.generateUrl('apps/oauth2/clients'))
.then((response) => {
this.clients = response.data;
});
},
methods: {
deleteClient(id) {
- let requestToken = OC.requestToken;
- let tokenHeaders = { headers: { requesttoken: requestToken } };
-
- axios.delete(OC.generateUrl('apps/oauth2/clients/{id}', {id: id}), tokenHeaders)
+ Axios.delete(OC.generateUrl('apps/oauth2/clients/{id}', {id: id}))
.then((response) => {
this.clients = this.clients.filter(client => client.id !== id);
});
},
addClient() {
- let requestToken = OC.requestToken;
- let tokenHeaders = { headers: { requesttoken: requestToken } };
this.newClient.error = false;
- axios.post(
+ Axios.post(
OC.generateUrl('apps/oauth2/clients'),
{
name: this.newClient.name,
redirectUri: this.newClient.redirectUri
- },
- tokenHeaders
+ }
).then(response => {
this.clients.push(response.data);