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:
@@ -55,6 +55,11 @@ export default function SecurityPage() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (newPassword === currentPassword) {
|
||||
setPasswordError("New password must be different from current password");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isPasswordValid(newPassword)) {
|
||||
setPasswordError("New password does not meet strength requirements");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user