Skip to content

fix(platform): surface missing-password error on the add-member form (#1470) - #1768

Merged
yannickmonney merged 1 commit into
mainfrom
fix/add-member-password-required
Jun 1, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/add-member-password-required

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Problem

On Settings → Organization → Add member, creating a brand-new user with an empty password failed with a generic "Failed to add member" toast and no field-level feedback — and the password field isn't marked required, so the user had no way to tell what was wrong (#1470).

Two underlying issues:

  1. create_member threw a plain Error('Password is required when creating a new user'), surfaced only as a generic toast.
  2. The password Input had no errorMessage prop, so a field-level error could never be displayed even if set.

Fix

  • create_member now throws a structured ConvexError({ code: 'PASSWORD_REQUIRED', … }) (same pattern as the existing DUPLICATE_NAME handling).
  • The add-member dialog catches that code and calls setError('password', …), keeping the dialog open so the user can add a password — instead of a generic toast.
  • Wired errorMessage={formState.errors.password?.message} onto the password Input.
  • Added auth.validation.passwordRequiredForNewUser in en/de/fr.

(Password stays optional when re-adding an existing user — that path is unaffected.)

Tests

  • member-add-dialog.test.tsx — new regression test: submitting with a valid email but empty password, with the backend rejecting PASSWORD_REQUIRED, shows the password field error and does not just toast. 3 passed.
  • tsc --noEmit, oxlint --type-aware, oxfmt, i18n parity (22) all pass.

Closes #1470

Adding a brand-new member with an empty password failed with a generic
"Failed to add member" toast and no field-level feedback, even though the
password field wasn't marked required — the user had no way to tell what
went wrong (#1470).

- create_member now throws a structured ConvexError ({ code: 'PASSWORD_REQUIRED' })
  instead of a plain Error.
- The add-member dialog catches that code and sets a field error on the
  password input (keeping the dialog open) instead of a generic toast.
- The password Input now actually renders its errorMessage (it previously
  had no errorMessage prop, so field errors could never display).
- Adds the auth.validation.passwordRequiredForNewUser i18n key (en/de/fr).

Closes #1470
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@yannickmonney, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 29 minutes and 36 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 164953c0-8ba8-4d4a-91e9-fad574ef6bac

📥 Commits

Reviewing files that changed from the base of the PR and between 0ab13fa and 7620b57.

📒 Files selected for processing (6)
  • services/platform/app/features/settings/organization/components/member-add-dialog.test.tsx
  • services/platform/app/features/settings/organization/components/member-add-dialog.tsx
  • services/platform/convex/users/create_member.ts
  • services/platform/messages/de.json
  • services/platform/messages/en.json
  • services/platform/messages/fr.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/add-member-password-required

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yannickmonney
yannickmonney merged commit 0da07f2 into main Jun 1, 2026
28 checks passed
@yannickmonney
yannickmonney deleted the fix/add-member-password-required branch June 1, 2026 07:31
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.

Bug: The password field is not marked required but the form is failed to submit when that field is empty

1 participant