parent
5fa9939696
commit
ad3bd312e9
@ -1,14 +1,18 @@
|
|||||||
<script>
|
<script>
|
||||||
import { getLocaleFromNavigator, _ } from "svelte-i18n";
|
import { getLocaleFromNavigator, _ } from "svelte-i18n";
|
||||||
import { passwordStrength } from "check-password-strength";
|
import { passwordStrength } from "check-password-strength";
|
||||||
export let password_change;
|
|
||||||
export let password_confirm;
|
|
||||||
$: strength = passwordStrength(password_change);
|
$: strength = passwordStrength(password_change);
|
||||||
$: passwords_match = (!password_confirm || (password_confirm === password_change))
|
$: passwords_match =
|
||||||
|
!password_confirm || password_confirm === password_change;
|
||||||
|
$: update_password_enabled =
|
||||||
|
strength?.contains.includes("lowercase") &&
|
||||||
|
strength?.contains.includes("uppercase") &&
|
||||||
|
strength?.contains.includes("number") &&
|
||||||
|
strength?.length > 9 &&
|
||||||
|
passwords_match == true;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="ml-4">
|
<div class="ml-4">
|
||||||
{(passwords_match)}
|
|
||||||
<ul class="list-disc font-medium tracking-wide text-red-500 text-xs">
|
<ul class="list-disc font-medium tracking-wide text-red-500 text-xs">
|
||||||
{#if !strength.contains.includes('lowercase')}
|
{#if !strength.contains.includes('lowercase')}
|
||||||
<li>Must contain a lowercase letter!</li>
|
<li>Must contain a lowercase letter!</li>
|
||||||
@ -19,10 +23,10 @@
|
|||||||
{#if !strength.contains.includes('number')}
|
{#if !strength.contains.includes('number')}
|
||||||
<li>Must contain a number letter!</li>
|
<li>Must contain a number letter!</li>
|
||||||
{/if}
|
{/if}
|
||||||
{#if !(strength.length>9)}
|
{#if !(strength.length > 9)}
|
||||||
<li>Must be at least 10 characters long!</li>
|
<li>Must be at least 10 characters long!</li>
|
||||||
{/if}
|
{/if}
|
||||||
{#if !(passwords_match==true)}
|
{#if !(passwords_match == true)}
|
||||||
<li>Passwords don't match!</li>
|
<li>Passwords don't match!</li>
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user