mirror of
https://github.com/RYDE-WORK/full-stack-fastapi-template.git
synced 2026-01-19 13:13:25 +08:00
♻️ Update login.tsx to prevent error if username or password are empty (#1257)
This commit is contained in:
parent
763afde09b
commit
8ba2459b75
@ -88,6 +88,7 @@ function Login() {
|
||||
<Input
|
||||
id="username"
|
||||
{...register("username", {
|
||||
required: "Username is required",
|
||||
pattern: emailPattern,
|
||||
})}
|
||||
placeholder="Email"
|
||||
@ -101,7 +102,9 @@ function Login() {
|
||||
<FormControl id="password" isInvalid={!!error}>
|
||||
<InputGroup>
|
||||
<Input
|
||||
{...register("password")}
|
||||
{...register("password", {
|
||||
required: "Password is required",
|
||||
})}
|
||||
type={show ? "text" : "password"}
|
||||
placeholder="Password"
|
||||
required
|
||||
@ -113,6 +116,7 @@ function Login() {
|
||||
}}
|
||||
>
|
||||
<Icon
|
||||
as={show ? ViewOffIcon : ViewIcon}
|
||||
onClick={setShow.toggle}
|
||||
aria-label={show ? "Hide password" : "Show password"}
|
||||
>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user