feat(core,dashboard): Add verifyCustomerAccount mutation to admin API#4773
feat(core,dashboard): Add verifyCustomerAccount mutation to admin API#4773latifniz wants to merge 1 commit into
Conversation
Adds a new admin-api mutation that allows administrators to manually verify a customer account without requiring an email verification token. This is useful when requireVerification is true but the customer never received the verification email (e.g. no email plugin configured in dev, or the email was lost). - Adds `verifyCustomerAccount(id: ID!): Customer!` to the admin GraphQL schema - Adds `CustomerService.verifyCustomerAccount()` which sets user.verified=true, clears the pending verification token, records a CUSTOMER_VERIFIED history entry, and emits AccountVerifiedEvent - Adds a "Verify account" button to the dashboard customer detail page, visible only when the customer status is Registered (not yet verified) - Adds e2e tests covering verification, history entry, event emission, and idempotency
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThis PR implements a new Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
I think this might already be covered by the existing admin customer creation flow in resolver/service layer. (password is missing in the dashboard ui) `CustomerService.create() is documented as:
and it already immediately verifies the customer when a password is provided by calling the existing verification flow internally. So from my understanding, admins can already create a verified customer account through the existing API/service behavior, previous angular admin ui already had this behaviour so maybe adding password in the dashboard ui may be the appropriate way to go ahead ( i am not a maintainer so , you should probably wait for maintainer take on it ),
As for this , dev server has mailbox where you can check all the emails to verify , while for b2b cases it normally requires much more complex verification flow than this , or the above method told should be used |
Description
Adds a
verifyCustomerAccount(id: ID!): Customer!mutation to the admin API,allowing administrators to manually verify a customer account without requiring
an email verification token.
This fills a gap when
authOptions.requireVerification: true(the default) butthe customer never received the verification email. for example when no email
plugin is configured in dev/staging, the email landed in spam, or during B2B
onboarding where the admin creates accounts on behalf of clients.
Changes:
verifyCustomerAccount(id: ID!): Customer!to the admin GraphQL schemaCustomerService.verifyCustomerAccount()which setsuser.verified = true,clears the pending verification token, records a
CUSTOMER_VERIFIEDhistoryentry and emits
AccountVerifiedEventonly when the customer status is "Registered" (not yet verified)
Relates to #4756
Breaking changes
None.
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.