Show actions instead of error when QR code is not a valid otp auth uri

This commit is contained in:
Bubka
2021-11-08 22:33:32 +01:00
parent 7efa86b232
commit 3edacf0824
5 changed files with 77 additions and 9 deletions

View File

@ -25,6 +25,19 @@ Vue.mixin({
this.$notify({ clean: true })
this.$router.push({ name: 'accounts' })
}
},
isUrl: function (url) {
var strRegex = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/
var re = new RegExp(strRegex)
return re.test(url)
},
openInBrowser(uri) {
const a = document.createElement('a')
a.setAttribute('href', uri)
a.dispatchEvent(new MouseEvent("click", {'view': window, 'bubbles': true, 'cancelable': true}))
}
}