Remove unnecessary OneTimePassword component

This commit is contained in:
Bubka
2020-01-22 15:27:33 +01:00
parent fda3f75fdb
commit 59e96a9491
3 changed files with 92 additions and 108 deletions

View File

@ -44,8 +44,8 @@
:twofaccountid='twofaccount.id'
:service='twofaccount.service'
:icon='twofaccount.icon'
:account='twofaccount.account'>
<one-time-password ref="OneTimePassword"></one-time-password>
:account='twofaccount.account'
ref="TwofaccountShow" >
</twofaccount-show>
</modal>
<footer class="has-background-black-ter">
@ -84,7 +84,6 @@
import Modal from '../components/Modal'
import TwofaccountShow from '../components/TwofaccountShow'
import OneTimePassword from '../components/OneTimePassword'
export default {
data(){
@ -135,7 +134,7 @@
// stop OTP generation on modal close
this.$on('modalClose', function() {
console.log('modalClose triggered')
this.$refs.OneTimePassword.clearOTP()
this.$refs.TwofaccountShow.clearOTP()
this.twofaccount.id = ''
this.twofaccount.service = ''
@ -148,27 +147,26 @@
components: {
Modal,
TwofaccountShow,
OneTimePassword
},
methods: {
getAccount(id) {
async getAccount(id) {
axios.get('api/twofaccounts/' + id)
.then(response => {
this.twofaccount.id = response.data.id
this.twofaccount.service = response.data.service
this.twofaccount.account = response.data.account
this.twofaccount.icon = response.data.icon
this.$refs.OneTimePassword.AccountId = response.data.id
this.$refs.OneTimePassword.getOTP()
this.ShowTwofaccountInModal = true;
})
const { data } = await axios.get('api/twofaccounts/' + id)
.catch(error => {
this.$router.push({ name: 'genericError', params: { err: error.response } });
});
this.twofaccount.id = data.id
this.twofaccount.service = data.service
this.twofaccount.account = data.account
this.twofaccount.icon = data.icon
this.$refs.TwofaccountShow.AccountId = data.id
await this.$refs.TwofaccountShow.getOTP()
this.ShowTwofaccountInModal = true
},
deleteAccount: function (id) {