Repository navigation
fix(platform): surface missing-password error on the add-member form (#1470) - #1768
Conversation
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
|
Warning Review limit reached
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 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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:
create_memberthrew a plainError('Password is required when creating a new user'), surfaced only as a generic toast.Inputhad noerrorMessageprop, so a field-level error could never be displayed even if set.Fix
create_membernow throws a structuredConvexError({ code: 'PASSWORD_REQUIRED', … })(same pattern as the existingDUPLICATE_NAMEhandling).setError('password', …), keeping the dialog open so the user can add a password — instead of a generic toast.errorMessage={formState.errors.password?.message}onto the passwordInput.auth.validation.passwordRequiredForNewUserinen/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 rejectingPASSWORD_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