Use nextcloud-axios in 2fa backupcodes js
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
057fab2e50
commit
9ccdc0a75c
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1644,8 +1644,7 @@
|
||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"aproba": {
|
"aproba": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
|
@ -2060,8 +2059,7 @@
|
||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
"version": "5.1.1",
|
"version": "5.1.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"safer-buffer": {
|
"safer-buffer": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
|
@ -2117,7 +2115,6 @@
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"ansi-regex": "^2.0.0"
|
"ansi-regex": "^2.0.0"
|
||||||
}
|
}
|
||||||
|
@ -2161,14 +2158,12 @@
|
||||||
"wrappy": {
|
"wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -2998,6 +2993,14 @@
|
||||||
"integrity": "sha512-vdqTKI9GBIYcAEbFAcpKPErKINfPF5zIuz3/niBfq8WUZjpT2tytLlFVrBgWdOtqI4uaA/Rb6No0hux39XXDuw==",
|
"integrity": "sha512-vdqTKI9GBIYcAEbFAcpKPErKINfPF5zIuz3/niBfq8WUZjpT2tytLlFVrBgWdOtqI4uaA/Rb6No0hux39XXDuw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"nextcloud-axios": {
|
||||||
|
"version": "0.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/nextcloud-axios/-/nextcloud-axios-0.1.3.tgz",
|
||||||
|
"integrity": "sha512-M2eLX0qrP8xy1VEGDhPXGwvV4W4gMnU1ysjnURVen8ehR1qRLdb/JfhJHab6XRsme7vWWMgSTEj+o3ibQ94N6g==",
|
||||||
|
"requires": {
|
||||||
|
"axios": "^0.18.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nextcloud-password-confirmation": {
|
"nextcloud-password-confirmation": {
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/nextcloud-password-confirmation/-/nextcloud-password-confirmation-0.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/nextcloud-password-confirmation/-/nextcloud-password-confirmation-0.1.0.tgz",
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.18.0",
|
"nextcloud-axios": "^0.1.3",
|
||||||
"nextcloud-password-confirmation": "^0.1.0",
|
"nextcloud-password-confirmation": "^0.1.0",
|
||||||
"vue": "^2.5.17"
|
"vue": "^2.5.17"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,21 +1,13 @@
|
||||||
import axio from 'axios';
|
import Axios from 'nextcloud-axios'
|
||||||
|
|
||||||
export function getState () {
|
export function getState () {
|
||||||
const url = OC.generateUrl('/apps/twofactor_backupcodes/settings/state');
|
const url = OC.generateUrl('/apps/twofactor_backupcodes/settings/state');
|
||||||
|
|
||||||
return axio.get(url, {
|
return Axios.get(url).then(resp => resp.data);
|
||||||
headers: {
|
|
||||||
requesttoken: OC.requestToken
|
|
||||||
}
|
|
||||||
}).then(resp => resp.data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function generateCodes () {
|
export function generateCodes () {
|
||||||
const url = OC.generateUrl('/apps/twofactor_backupcodes/settings/create');
|
const url = OC.generateUrl('/apps/twofactor_backupcodes/settings/create');
|
||||||
|
|
||||||
return axio.post(url, {}, {
|
return Axios.post(url, {}).then(resp => resp.data)
|
||||||
headers: {
|
|
||||||
requesttoken: OC.requestToken
|
|
||||||
}
|
|
||||||
}).then(resp => resp.data)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue