mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
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
5 changed files with 20 additions and 25 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
21
apps/twofactor_backupcodes/package-lock.json
generated
21
apps/twofactor_backupcodes/package-lock.json
generated
|
|
@ -1644,8 +1644,7 @@
|
|||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"aproba": {
|
||||
"version": "1.2.0",
|
||||
|
|
@ -2060,8 +2059,7 @@
|
|||
"safe-buffer": {
|
||||
"version": "5.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
|
|
@ -2117,7 +2115,6 @@
|
|||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
|
|
@ -2161,14 +2158,12 @@
|
|||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -2998,6 +2993,14 @@
|
|||
"integrity": "sha512-vdqTKI9GBIYcAEbFAcpKPErKINfPF5zIuz3/niBfq8WUZjpT2tytLlFVrBgWdOtqI4uaA/Rb6No0hux39XXDuw==",
|
||||
"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": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/nextcloud-password-confirmation/-/nextcloud-password-confirmation-0.1.0.tgz",
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
"author": "",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"axios": "^0.18.0",
|
||||
"nextcloud-axios": "^0.1.3",
|
||||
"nextcloud-password-confirmation": "^0.1.0",
|
||||
"vue": "^2.5.17"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,21 +1,13 @@
|
|||
import axio from 'axios';
|
||||
import Axios from 'nextcloud-axios'
|
||||
|
||||
export function getState () {
|
||||
const url = OC.generateUrl('/apps/twofactor_backupcodes/settings/state');
|
||||
|
||||
return axio.get(url, {
|
||||
headers: {
|
||||
requesttoken: OC.requestToken
|
||||
}
|
||||
}).then(resp => resp.data);
|
||||
return Axios.get(url).then(resp => resp.data);
|
||||
}
|
||||
|
||||
export function generateCodes () {
|
||||
const url = OC.generateUrl('/apps/twofactor_backupcodes/settings/create');
|
||||
|
||||
return axio.post(url, {}, {
|
||||
headers: {
|
||||
requesttoken: OC.requestToken
|
||||
}
|
||||
}).then(resp => resp.data)
|
||||
return Axios.post(url, {}).then(resp => resp.data)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue