mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-09 13:55:01 +02:00
Show actions instead of error when QR code is not a valid otp auth uri
This commit is contained in:
13
resources/js/mixins.js
vendored
13
resources/js/mixins.js
vendored
@ -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}))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user