mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-27 17:27:32 +08:00
chore: add one more guard check
This commit is contained in:
parent
7440f70b04
commit
c695fb1eda
1 changed files with 7 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue