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/RegistrationPage.tsx | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

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

diff --git a/packages/demobank-ui/src/pages/RegistrationPage.tsx b/packages/demobank-ui/src/pages/RegistrationPage.tsx
index 12b3b6978..305f53750 100644
--- a/packages/demobank-ui/src/pages/RegistrationPage.tsx
+++ b/packages/demobank-ui/src/pages/RegistrationPage.tsx
@@ -47,7 +47,8 @@ export function RegistrationPage(): VNode {
   );
 }
 
-export const USERNAME_REGEX = /^[a-z][a-zA-Z0-9]+$/;
+export const USERNAME_REGEX = /^[a-z][a-zA-Z0-9]*$/;
+export const PASSWORD_REGEX = /^[a-z0-9][a-zA-Z0-9]*$/;
 
 /**
  * Collect and submit registration data.
@@ -65,17 +66,17 @@ function RegistrationForm(): 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`
-      : !USERNAME_REGEX.test(password)
-      ? i18n.str`Use only letter and numbers starting with a lower case letter`
+      : !PASSWORD_REGEX.test(password)
+      ? i18n.str`Use letters and numbers only, and start with a lowercase letter`
       : undefined,
     repeatPassword: !repeatPassword
       ? i18n.str`Missing password`
       : repeatPassword !== password
-      ? i18n.str`Password don't match`
+      ? i18n.str`Passwords don't match`
       : undefined,
   });
 
-- 
cgit v1.2.3

