Prevent same old/new password

Add client-side validation in SecurityPage to alert when the new password matches the current password, preventing submission and showing an error.

X-Lovable-Edit-ID: edt-3a30092e-86a6-4d0a-892f-19ece7859cfe
This commit is contained in:
gpt-engineer-app[bot]
2026-01-11 08:20:16 +00:00
+5
View File
@@ -55,6 +55,11 @@ export default function SecurityPage() {
return; return;
} }
if (newPassword === currentPassword) {
setPasswordError("New password must be different from current password");
return;
}
if (!isPasswordValid(newPassword)) { if (!isPasswordValid(newPassword)) {
setPasswordError("New password does not meet strength requirements"); setPasswordError("New password does not meet strength requirements");
return; return;