Browse Source
♻️ Update login.tsx to prevent error if username or password are empty (#1257)
pull/13907/head
jmondaud
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
5 additions and
1 deletions
-
frontend/src/routes/login.tsx
|
|
@ -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"} |
|
|
|
> |
|
|
|