gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: marc suggestions from email


From: gnunet
Subject: [taler-wallet-core] branch master updated: marc suggestions from email
Date: Fri, 30 Dec 2022 18:29:19 +0100

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 90ec5b51e marc suggestions from email
90ec5b51e is described below

commit 90ec5b51eadc6e018fd0b2e64dfd3fee647db281
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Fri Dec 30 14:23:58 2022 -0300

    marc suggestions from email
---
 packages/demobank-ui/src/pages/LoginForm.tsx        | 10 +++++++---
 packages/demobank-ui/src/pages/RegistrationPage.tsx | 11 ++++++-----
 2 files changed, 13 insertions(+), 8 deletions(-)

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 (
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,
   });
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]