diff options
Diffstat (limited to 'packages/demobank-ui/src/pages/LoginForm.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/LoginForm.tsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/demobank-ui/src/pages/LoginForm.tsx b/packages/demobank-ui/src/pages/LoginForm.tsx index dd0364d6e..1fbba357b 100644 --- a/packages/demobank-ui/src/pages/LoginForm.tsx +++ b/packages/demobank-ui/src/pages/LoginForm.tsx @@ -23,6 +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"; /** * Collect and submit login data. @@ -38,7 +39,11 @@ export function LoginForm(): VNode { }, []); const errors = undefinedIfEmpty({ - username: !username ? i18n.str`Missing username` : undefined, + username: !username + ? i18n.str`Missing 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` : undefined, }); @@ -50,6 +55,9 @@ export function LoginForm(): VNode { onSubmit={(e) => { e.preventDefault(); }} + autoCapitalize="none" + autoCorrect="off" + autoComplete="off" > <div class="pure-form"> <h2>{i18n.str`Please login!`}</h2> |