fix(backend): Update params and documention on createUser - #9305
Conversation
Add the optional `emailAddressIdentificationStatus` and `phoneNumberIdentificationStatus` parameters to `CreateUserParams`. The Backend API has supported these arrays on `POST /v1/users` since they shipped, but `createUser()` had no way to pass them, so every email address and phone number was necessarily created verified. Each array runs parallel to `emailAddress` / `phoneNumber` — one item per identifier, applied by position — and an item set to `'reserved'` creates that identifier unverified but still usable for sign-in and locked so no other user can claim it. The `createUser()` documentation is corrected accordingly: it stated unconditionally that created email addresses and phone numbers are automatically verified, which is only the default.
🦋 Changeset detectedLatest commit: 6754033 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
📝 WalkthroughWalkthroughThe backend Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/backend/src/api/endpoints/UserApi.ts (1)
239-239: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAdd request-body coverage for both status arrays.
The existing
createUser()test path does not send either new field or inspect the request body. Add a test with mixed'verified'and'reserved'values. Assert that both arrays and their positional order are preserved.Also applies to: 243-243
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/backend/src/api/endpoints/UserApi.ts` at line 239, Add request-body coverage in the existing createUser() test path for both new status-array fields, supplying mixed 'verified' and 'reserved' values. Capture or inspect the outgoing request body and assert that each array is present with its values preserved in the original positional order.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/backend/src/api/endpoints/UserApi.ts`:
- Line 239: Add request-body coverage in the existing createUser() test path for
both new status-array fields, supplying mixed 'verified' and 'reserved' values.
Capture or inspect the outgoing request body and assert that each array is
present with its values preserved in the original positional order.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: da20e0b8-caec-4806-acf1-7778b2aa5fb5
📒 Files selected for processing (2)
.changeset/backend-create-user-identification-status.mdpackages/backend/src/api/endpoints/UserApi.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
clerk/clerk_go(manual)clerk/dashboard(manual)clerk/accounts(manual)clerk/backoffice(manual)clerk/clerk(manual)clerk/clerk-docs(manual)clerk/cloudflare-workers(manual)clerk/clerk-ios(auto-detected)clerk/clerk-android(auto-detected)clerk/cli(auto-detected)
Add the optional
emailAddressIdentificationStatusandphoneNumberIdentificationStatusparameters toCreateUserParams. The Backend API has supported these arrays onPOST /v1/userssince they shipped, butcreateUser()had no way to pass them, so every email address and phone number was necessarily created verified. Each array runs parallel toemailAddress/phoneNumber— one item per identifier, applied by position — and an item set to'reserved'creates that identifier unverified but still usable for sign-in and locked so no other user can claim it.The
createUser()documentation is corrected accordingly: it stated unconditionally that created email addresses and phone numbers are automatically verified, which is only the default.Description
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change