diff --git a/packages/demobank-ui/src/pages/LoginForm.tsx b/packages/demobank-ui/src/pages/LoginForm.tsx index 3d4279f99..2452745a5 100644 --- a/packages/demobank-ui/src/pages/LoginForm.tsx +++ b/packages/demobank-ui/src/pages/LoginForm.tsx @@ -20,7 +20,7 @@ import { useEffect, useRef, useState } from "preact/hooks"; import { useBackendContext } from "../context/backend.js"; import { bankUiSettings } from "../settings.js"; import { undefinedIfEmpty } from "../utils.js"; -import { PASSWORD_REGEX, USERNAME_REGEX } from "./RegistrationPage.js"; +import { USERNAME_REGEX } from "./RegistrationPage.js"; import { ShowInputErrorLabel } from "./ShowInputErrorLabel.js"; /** @@ -32,7 +32,7 @@ export function LoginForm({ onRegister }: { onRegister: () => void }): VNode { const [password, setPassword] = useState(); const { i18n } = useTranslationContext(); const ref = useRef(null); - useEffect(() => { + useEffect(function focusInput() { ref.current?.focus(); }, []); @@ -42,17 +42,12 @@ export function LoginForm({ onRegister }: { onRegister: () => void }): VNode { : !USERNAME_REGEX.test(username) ? 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 (

{i18n.str`Welcome to ${bankUiSettings.bankName}!`}

-