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 @@

- @@ -133,6 +133,7 @@ counterIsLocked: true, twofaccountExists: false, tempIcon: '', + secretIsBase32Encoded: null, form: new Form({ service: '', account: '', @@ -140,7 +141,6 @@ uri: '', icon: '', secret: '', - secretIsBase32Encoded: null, algorithm: '', digits: null, counter: null, @@ -196,7 +196,7 @@ const { data } = await this.axios.get('/api/v1/twofaccounts/' + this.$route.params.twofaccountId) this.form.fill(data) - this.form.secretIsBase32Encoded = 1 + this.secretIsBase32Encoded = 1 this.twofaccountExists = true // set account icon as temp icon @@ -218,7 +218,7 @@ } // 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.put('/api/v1/twofaccounts/' + this.$route.params.twofaccountId)