Skip to content

fix: Password requirement are not clear on the email signup page#3771

Open
cursor[bot] wants to merge 1 commit intomainfrom
cursor/agent-b436d798
Open

fix: Password requirement are not clear on the email signup page#3771
cursor[bot] wants to merge 1 commit intomainfrom
cursor/agent-b436d798

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor bot commented Mar 28, 2026

Summary

Adds password requirement hints and client-side validation to the email signup form on the login page, matching the existing pattern from the Owner Setup page (OwnerSetup.tsx).

Changes

  • Added a password hint below the password field: "8+ characters, at least 1 number and 1 capital letter"
  • Added isPasswordValid() function (same logic as OwnerSetup.tsx) to validate password on form submit
  • Added per-field error messages for password and confirm password fields
  • Error text replaces the hint text when validation fails, following the same pattern used in OwnerSetup.tsx

Before / After

Before: No password requirements shown on the signup form — users only discover requirements after a failed submit.

After: Password requirements are visible as a hint below the password field. If validation fails on submit, field-level error messages replace the hint.

Closes #1647

Open in Web Open in Cursor 

Add password hint text and client-side validation to the signup form
in Login.tsx, matching the existing pattern from OwnerSetup.tsx.

- Display '8+ characters, at least 1 number and 1 capital letter'
  hint below the password field
- Validate password meets requirements on submit
- Show per-field error messages for password and confirm password
- Follows the same isPasswordValid logic and error styling used in
  the owner setup page

Closes #1647
@superplanehq-integration
Copy link
Copy Markdown

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

Copy link
Copy Markdown
Contributor Author

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

}

setSignupFieldErrors(fieldErrors);
if (Object.keys(fieldErrors).length > 0) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale field errors persist after early return

Medium Severity

handleSignupSubmit clears formError at the top (line 372) but never clears signupFieldErrors. The call to setSignupFieldErrors(fieldErrors) only happens at line 399, which is after the early returns for missing name (line 383) and missing email/password (line 388). If a user first triggers a password field error, then triggers one of those early returns on the next submit, the stale red password error text remains visible alongside the new formError banner.

Fix in Cursor Fix in Web

if (!/[0-9]/.test(password)) return false;
if (!/[A-Z]/.test(password)) return false;
return true;
};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated isPasswordValid function across two files

Low Severity

isPasswordValid is duplicated verbatim in both Login.tsx and OwnerSetup.tsx. If password requirements change, both copies need to be updated in lockstep, which is error-prone. This is a good candidate for extraction into a shared utility.

Fix in Cursor Fix in Web

const [signupEmail, setSignupEmail] = useState("");
const [signupPassword, setSignupPassword] = useState("");
const [signupConfirmPassword, setSignupConfirmPassword] = useState("");
const [signupFieldErrors, setSignupFieldErrors] = useState<Record<string, string>>({});
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field errors not cleared when toggling modes

Low Severity

The newly introduced signupFieldErrors state is not cleared in handleToggleMode (which clears formError but not signupFieldErrors). If a user triggers password field errors, switches to login mode, and then switches back to signup mode, the stale red error text remains visible on the password field instead of reverting to the hint.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Password requirement are not clear on the email signup page

1 participant