diff --git a/frontend/src/ts/popups/simple-popups.ts b/frontend/src/ts/popups/simple-popups.ts index b96fc7efa..539e37744 100644 --- a/frontend/src/ts/popups/simple-popups.ts +++ b/frontend/src/ts/popups/simple-popups.ts @@ -20,6 +20,7 @@ import { unlink, updatePassword, } from "firebase/auth"; +import { isPasswordStrong } from "../utils/misc"; interface Input { placeholder?: string; @@ -524,6 +525,17 @@ list["updatePassword"] = new SimplePopup( Notifications.add("New passwords don't match", 0); return; } + if ( + window.location.hostname !== "localhost" && + !isPasswordStrong(newPass) + ) { + Notifications.add( + "New password must contain at least one capital letter, number, a special character and at least 8 characters long", + 0, + 4 + ); + return; + } Loader.show(); await reauthenticateWithCredential(user, credential); await updatePassword(user, newPass);