mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-09 13:55:01 +02:00
Generate and Show all OTPs directly on the main view - Complete #153
This commit is contained in:
11
resources/js/mixins.js
vendored
11
resources/js/mixins.js
vendored
@ -126,6 +126,17 @@ Vue.mixin({
|
||||
|
||||
this.setTheme(this.$root.userPreferences.theme)
|
||||
},
|
||||
|
||||
displayPwd(pwd) {
|
||||
if (this.$root.userPreferences.formatPassword && pwd.length > 0) {
|
||||
const x = Math.ceil(this.$root.userPreferences.formatPasswordBy < 1 ? pwd.length * this.$root.userPreferences.formatPasswordBy : this.$root.userPreferences.formatPasswordBy)
|
||||
const chunks = pwd.match(new RegExp(`.{1,${x}}`, 'g'));
|
||||
if (chunks) {
|
||||
pwd = chunks.join(' ')
|
||||
}
|
||||
}
|
||||
return this.$root.userPreferences.showOtpAsDot ? pwd.replace(/[0-9]/g, '●') : pwd
|
||||
},
|
||||
}
|
||||
|
||||
})
|
Reference in New Issue
Block a user