Skip to content

Commit 8ba2459

Browse files
authored
♻️ Update login.tsx to prevent error if username or password are empty (#1257)
1 parent 763afde commit 8ba2459

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

frontend/src/routes/login.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ function Login() {
8888
<Input
8989
id="username"
9090
{...register("username", {
91+
required: "Username is required",
9192
pattern: emailPattern,
9293
})}
9394
placeholder="Email"
@@ -101,7 +102,9 @@ function Login() {
101102
<FormControl id="password" isInvalid={!!error}>
102103
<InputGroup>
103104
<Input
104-
{...register("password")}
105+
{...register("password", {
106+
required: "Password is required",
107+
})}
105108
type={show ? "text" : "password"}
106109
placeholder="Password"
107110
required
@@ -113,6 +116,7 @@ function Login() {
113116
}}
114117
>
115118
<Icon
119+
as={show ? ViewOffIcon : ViewIcon}
116120
onClick={setShow.toggle}
117121
aria-label={show ? "Hide password" : "Show password"}
118122
>

0 commit comments

Comments
 (0)