diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-12-07 13:57:50 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-12-07 13:57:50 +0100 |
commit | c1f1dd18fc497a6dd456ceef19521e6d99b6752d (patch) | |
tree | 2fc4d308d4ca3aeaa12be27bfb7d818f02a22cf9 /apps/oauth2/src/App.vue | |
parent | 1f492322a8b83c8a5f5aba44058218316ed2908b (diff) | |
download | nextcloud-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.vue | 19 |
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); |