Skip to content

Commit

Permalink
fix: resolved form validation for no password (remix-run#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardHpa authored May 17, 2022
1 parent 142a0df commit 49b2240
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/routes/join.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const action: ActionFunction = async ({ request }) => {
);
}

if (typeof password !== "string") {
if (typeof password !== "string" || password.length === 0) {
return json<ActionData>(
{ errors: { password: "Password is required" } },
{ status: 400 }
Expand Down
2 changes: 1 addition & 1 deletion app/routes/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const action: ActionFunction = async ({ request }) => {
);
}

if (typeof password !== "string") {
if (typeof password !== "string" || password.length === 0) {
return json<ActionData>(
{ errors: { password: "Password is required" } },
{ status: 400 }
Expand Down

0 comments on commit 49b2240

Please sign in to comment.