Update OTP generation to work with new TwoFAccount model

This commit is contained in:
Bubka
2020-11-12 00:15:55 +01:00
parent 783fc82fc9
commit 8baa2156a8
3 changed files with 20 additions and 44 deletions

View File

@ -99,7 +99,7 @@
getTOTP: function() {
this.axios.post('/api/twofaccounts/otp', {data: this.id ? this.id : this.internal_uri }).then(response => {
this.axios.post('/api/twofaccounts/otp', { id: this.id, uri: this.internal_uri }).then(response => {
let spacePosition = Math.ceil(response.data.otp.length / 2);
this.otp = response.data.otp.substr(0, spacePosition) + " " + response.data.otp.substr(spacePosition);
@ -143,7 +143,7 @@
getHOTP: function() {
this.axios.post('/api/twofaccounts/otp', {data: this.id ? this.id : this.internal_uri }).then(response => {
this.axios.post('/api/twofaccounts/otp', { id: this.id, uri: this.internal_uri }).then(response => {
let spacePosition = Math.ceil(response.data.otp.length / 2);
this.otp = response.data.otp.substr(0, spacePosition) + " " + response.data.otp.substr(spacePosition)