fix: enforce default blocked domains list independently and migrate validateEmailDomain to TypeScript#40030
Conversation
…alidateEmailDomain to TypeScript
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: c8af27e The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (12)📓 Common learnings📚 Learning: 2026-02-24T19:05:56.710ZApplied to files:
📚 Learning: 2026-03-16T21:50:37.589ZApplied to files:
📚 Learning: 2026-03-18T16:08:17.800ZApplied to files:
📚 Learning: 2026-03-03T11:11:48.541ZApplied to files:
📚 Learning: 2026-03-16T21:50:42.118ZApplied to files:
📚 Learning: 2026-01-17T01:51:47.764ZApplied to files:
📚 Learning: 2026-03-18T22:07:19.687ZApplied to files:
📚 Learning: 2026-03-15T14:31:28.969ZApplied to files:
📚 Learning: 2025-11-05T20:53:57.761ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
🔇 Additional comments (5)
WalkthroughA bug fix addresses the issue where the default blocked domains list was not being enforced when a custom blocked domains list was provided but left empty. The fix separates sequential validation checks and adds TypeScript typings to the email domain validation function. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
Proposed changes
Fixes default blocked domains list not being enforced when custom blocked
domains list is empty. Also migrates
validateEmailDomain.jsto TypeScript.Closes #40029
Changes made
Migrated
validateEmailDomain.js→validateEmailDomain.tsAdded proper TypeScript types:
emailDomainBlackList: string[]emailDomainWhiteList: string[]email: stringparameter typePromise<void>return type onvalidateEmailDomainFixed bug: split the email domain blacklist check into two independent
conditions so the default blocked domains list is enforced regardless
of whether the custom list is empty or not
Root cause:
The default blocklist check was nested inside
emailDomainBlackList.length &&in
validateEmailDomain.js. When the custom list was empty, the entirecondition short-circuited and the default list was never checked.
How to test:
Try registering with
[hello@yopmail.com](mailto:hello@yopmail.com)or any other email that uses domain fromapps/meteor/app/lib/server/lib/defaultBlockedDomainsList.tsshould now be blocked
Type of change
Bug fix
Refactor (migration from JS to TypeScript)
Summary by CodeRabbit