= 14) {
+ strength = "strong";
+ } else if (password.length >= VALIDATION_CONFIG.MIN_PASSWORD_LENGTH) {
+ strength = "good";
+ }
+ }
if (password.length >= 16) {
strength = "strong";
} else if (password.length >= 12) {
diff --git a/src/routes/account.tsx b/src/routes/account.tsx
index 36104f3..28656da 100644
--- a/src/routes/account.tsx
+++ b/src/routes/account.tsx
@@ -16,6 +16,7 @@ import { VALIDATION_CONFIG } from "~/config";
import { api } from "~/lib/api";
import type { UserProfile } from "~/types/user";
+import PasswordStrengthMeter from "~/components/PasswordStrengthMeter";
const getUserProfile = query(async (): Promise => {
"use server";
@@ -84,6 +85,7 @@ export default function AccountPage() {
const [passwordBlurred, setPasswordBlurred] = createSignal(false);
const [passwordError, setPasswordError] = createSignal(false);
const [passwordDeletionError, setPasswordDeletionError] = createSignal(false);
+ const [newPassword, setNewPassword] = createSignal("");
const [showOldPasswordInput, setShowOldPasswordInput] = createSignal(false);
const [showPasswordInput, setShowPasswordInput] = createSignal(false);
@@ -433,6 +435,7 @@ export default function AccountPage() {
const handleNewPasswordChange = (e: Event) => {
const target = e.target as HTMLInputElement;
+ setNewPassword(target.value);
checkPasswordLength(target.value);
if (newPasswordConfRef) {
checkForMatch(target.value, newPasswordConfRef.value);
@@ -838,9 +841,21 @@ export default function AccountPage() {
>
}
+ fallback={
+
+ }
>
-
+
@@ -861,6 +876,9 @@ export default function AccountPage() {
/>
+