diff --git a/resources/js/components/OtpDisplayer.vue b/resources/js/components/OtpDisplayer.vue index bd55fac2..484ff47b 100644 --- a/resources/js/components/OtpDisplayer.vue +++ b/resources/js/components/OtpDisplayer.vue @@ -52,7 +52,6 @@ counter : null, image : String, qrcode : null, - secretIsBase32Encoded : Number, uri : String }, diff --git a/resources/js/views/twofaccounts/Create.vue b/resources/js/views/twofaccounts/Create.vue index 73638c62..6ada48e3 100644 --- a/resources/js/views/twofaccounts/Create.vue +++ b/resources/js/views/twofaccounts/Create.vue @@ -87,7 +87,7 @@
- @@ -187,13 +187,13 @@ showAlternatives : false, tempIcon: '', uri: '', + secretIsBase32Encoded: 0, form: new Form({ service: '', account: '', otp_type: '', icon: '', secret: '', - secretIsBase32Encoded: 0, algorithm: '', digits: null, counter: null, @@ -241,6 +241,7 @@ this.axios.post('/api/v1/twofaccounts/preview', { uri: this.uri }).then(response => { this.form.fill(response.data) + this.secretIsBase32Encoded = 1 this.tempIcon = response.data.icon ? response.data.icon : null this.showQuickForm = true }) @@ -277,7 +278,7 @@ this.form.icon = this.tempIcon // Secret to base32 if necessary - this.form.secret = this.form.secretIsBase32Encoded ? this.form.secret : Base32.encode(this.form.secret).toString(); + this.form.secret = this.secretIsBase32Encoded ? this.form.secret : Base32.encode(this.form.secret).toString(); await this.form.post('/api/v1/twofaccounts') @@ -318,7 +319,7 @@ // Then the otp described by the uri this.axios.post('/api/v1/twofaccounts/preview', { uri: data.data }).then(response => { this.form.fill(response.data) - this.form.secretIsBase32Encoded = 1 + this.secretIsBase32Encoded = 1 this.tempIcon = response.data.icon ? response.data.icon : null }) .catch(error => { diff --git a/resources/js/views/twofaccounts/Edit.vue b/resources/js/views/twofaccounts/Edit.vue index 6c89cf0d..b1c92bed 100644 --- a/resources/js/views/twofaccounts/Edit.vue +++ b/resources/js/views/twofaccounts/Edit.vue @@ -33,7 +33,7 @@
-