mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
fixed strength meter
This commit is contained in:
parent
0d243b225e
commit
15d03f18f7
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user