fixed strength meter

This commit is contained in:
Ulf Gebhardt 2019-05-10 12:21:24 +02:00
parent 0d243b225e
commit 15d03f18f7
No known key found for this signature in database
GPG Key ID: 44C888923CC8E7F3

View File

@ -1,16 +1,10 @@
<template> <template>
<div class="field"> <div class="field">
<div class="password-strength-meter"> <div class="password-strength-meter">
<div <div class="password-strength-meter-inner" :class="strengthClass"/>
class="password-strength-meter-inner"
:class="strengthClass"
/>
</div> </div>
<p class="help"> <p class="help">
<span <span v-if="pass" :class="{ insecure: (passwordStrength < 3) }">
v-if="pass"
:class="{ insecure: (passwordStrength < 3) }"
>
{{ $t('settings.security.change-password.passwordSecurity') }}: {{ $t('settings.security.change-password.passwordSecurity') }}:
<strong>{{ $t(`settings.security.change-password.passwordStrength${passwordStrength}`) }}</strong> <strong>{{ $t(`settings.security.change-password.passwordStrength${passwordStrength}`) }}</strong>
</span> </span>
@ -40,9 +34,7 @@ export default {
computed: { computed: {
strengthClass() { strengthClass() {
return `strength-${this.passwordStrength}` return `strength-${this.passwordStrength}`
} },
},
watch: {
/** /**
* passwordStrength is the score calculated by zxcvbn * passwordStrength is the score calculated by zxcvbn
* @return {Number} Password Strength Score * @return {Number} Password Strength Score
@ -57,7 +49,9 @@ export default {
}) })
} }
return score return score
}, }
},
watch: {
password(pass) { password(pass) {
// update password when prop is changing // update password when prop is changing
this.pass = pass || null this.pass = pass || null