From 90ec5b51eadc6e018fd0b2e64dfd3fee647db281 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Fri, 30 Dec 2022 14:23:58 -0300
Subject: marc suggestions from email

---
 packages/demobank-ui/src/pages/LoginForm.tsx | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

(limited to 'packages/demobank-ui/src/pages/LoginForm.tsx')

diff --git a/packages/demobank-ui/src/pages/LoginForm.tsx b/packages/demobank-ui/src/pages/LoginForm.tsx
index 1fbba357b..552238eeb 100644
--- a/packages/demobank-ui/src/pages/LoginForm.tsx
+++ b/packages/demobank-ui/src/pages/LoginForm.tsx
@@ -23,7 +23,7 @@ import { BackendStateHandler } from "../hooks/backend.js";
 import { bankUiSettings } from "../settings.js";
 import { getBankBackendBaseUrl, undefinedIfEmpty } from "../utils.js";
 import { ShowInputErrorLabel } from "./ShowInputErrorLabel.js";
-import { USERNAME_REGEX } from "./RegistrationPage.js";
+import { USERNAME_REGEX, PASSWORD_REGEX } from "./RegistrationPage.js";
 
 /**
  * Collect and submit login data.
@@ -42,9 +42,13 @@ export function LoginForm(): VNode {
     username: !username
       ? i18n.str`Missing username`
       : !USERNAME_REGEX.test(username)
-      ? i18n.str`Use only letter and numbers starting with a lower case letter`
+      ? i18n.str`Use letters and numbers only, and start with a lowercase letter`
+      : undefined,
+    password: !password
+      ? i18n.str`Missing password`
+      : !PASSWORD_REGEX.test(password)
+      ? i18n.str`Use letters and numbers only, and start with a lowercase letter or number`
       : undefined,
-    password: !password ? i18n.str`Missing password` : undefined,
   });
 
   return (
-- 
cgit v1.2.3

