diff options
author | Sebastian <sebasjm@gmail.com> | 2022-12-30 10:42:15 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-12-30 10:42:15 -0300 |
commit | 26d94c4ba7dd12cfa433d0c037f3bba8f73995f4 (patch) | |
tree | 647cdb4c2facda296fd5109ffb4709345b411626 /packages/demobank-ui/src/pages/RegistrationPage.tsx | |
parent | 7d0990fe896247467c3b72c965f78279a86e6f64 (diff) | |
download | wallet-core-26d94c4ba7dd12cfa433d0c037f3bba8f73995f4.tar.xz |
add login username validation & prevent safari to capitalize
Diffstat (limited to 'packages/demobank-ui/src/pages/RegistrationPage.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/RegistrationPage.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/demobank-ui/src/pages/RegistrationPage.tsx b/packages/demobank-ui/src/pages/RegistrationPage.tsx index 183fa993e..12b3b6978 100644 --- a/packages/demobank-ui/src/pages/RegistrationPage.tsx +++ b/packages/demobank-ui/src/pages/RegistrationPage.tsx @@ -47,7 +47,7 @@ export function RegistrationPage(): VNode { ); } -const usernameRegex = /^[a-z][a-zA-Z0-9]+$/; +export const USERNAME_REGEX = /^[a-z][a-zA-Z0-9]+$/; /** * Collect and submit registration data. @@ -64,12 +64,12 @@ function RegistrationForm(): VNode { const errors = undefinedIfEmpty({ username: !username ? i18n.str`Missing username` - : !usernameRegex.test(username) + : !USERNAME_REGEX.test(username) ? i18n.str`Use only letter and numbers starting with a lower case letter` : undefined, password: !password ? i18n.str`Missing password` - : !usernameRegex.test(password) + : !USERNAME_REGEX.test(password) ? i18n.str`Use only letter and numbers starting with a lower case letter` : undefined, repeatPassword: !repeatPassword |