chore: add one more guard check

This commit is contained in:
Miodec 2023-09-26 17:09:08 +01:00
parent 7440f70b04
commit c695fb1eda

View file

@ -648,13 +648,19 @@ list["updatePassword"] = new SimplePopup(
"Update",
async (_thisPopup, previousPass, newPass, newPassConfirm) => {
if (newPass !== newPassConfirm) {
Notifications.add("New passwords don't match", 0);
return {
status: 0,
message: "New passwords don't match",
};
}
if (newPass === previousPass) {
return {
status: 0,
message: "New password must be different from previous password",
};
}
if (!isLocalhost() && !isPasswordStrong(newPass)) {
return {
status: 0,