♻️ Update login.tsx to prevent error if username or password are empty (#1257)
This commit is contained in:
@@ -88,6 +88,7 @@ function Login() {
|
|||||||
<Input
|
<Input
|
||||||
id="username"
|
id="username"
|
||||||
{...register("username", {
|
{...register("username", {
|
||||||
|
required: "Username is required",
|
||||||
pattern: emailPattern,
|
pattern: emailPattern,
|
||||||
})}
|
})}
|
||||||
placeholder="Email"
|
placeholder="Email"
|
||||||
@@ -101,7 +102,9 @@ function Login() {
|
|||||||
<FormControl id="password" isInvalid={!!error}>
|
<FormControl id="password" isInvalid={!!error}>
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
<Input
|
<Input
|
||||||
{...register("password")}
|
{...register("password", {
|
||||||
|
required: "Password is required",
|
||||||
|
})}
|
||||||
type={show ? "text" : "password"}
|
type={show ? "text" : "password"}
|
||||||
placeholder="Password"
|
placeholder="Password"
|
||||||
required
|
required
|
||||||
@@ -113,6 +116,7 @@ function Login() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon
|
||||||
|
as={show ? ViewOffIcon : ViewIcon}
|
||||||
onClick={setShow.toggle}
|
onClick={setShow.toggle}
|
||||||
aria-label={show ? "Hide password" : "Show password"}
|
aria-label={show ? "Hide password" : "Show password"}
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user