From ee848679b1185be46362766a0c42cba36ced7615 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 13 Sep 2020 18:50:35 +0300 Subject: [PATCH] Migration: add a minimum password length requirement. --- src/MigrateV2.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MigrateV2.tsx b/src/MigrateV2.tsx index ac55c6c..d0b849f 100644 --- a/src/MigrateV2.tsx +++ b/src/MigrateV2.tsx @@ -86,6 +86,8 @@ export default function MigrateV2(props: PropsType) { ); } +const PASSWORD_MIN_LENGTH = 8; + interface OurPagePropsType extends PropsType, PagePropsType { etebase?: Etebase.Account; } @@ -138,6 +140,8 @@ export function WizardAccountPage(props: OurPagePropsType & { setEtebase: (eteba } if (!password) { errors.errorPassword = fieldRequired; + } else if (password.length < PASSWORD_MIN_LENGTH) { + errors.errorPassword = `Passwourds should be at least ${PASSWORD_MIN_LENGTH} digits long.`; } if (showAdvanced && !server.startsWith("http")) { errors.errorServer = "Server URI must start with http/https://";