From c695fb1edaeec653744f82b4de3c3ef93225fec0 Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 26 Sep 2023 17:09:08 +0100 Subject: [PATCH] chore: add one more guard check --- frontend/src/ts/popups/simple-popups.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/ts/popups/simple-popups.ts b/frontend/src/ts/popups/simple-popups.ts index d1acbfa21..601b685f8 100644 --- a/frontend/src/ts/popups/simple-popups.ts +++ b/frontend/src/ts/popups/simple-popups.ts @@ -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,