Block signups from .shop, .top, and .xyz email TLDs#748
Open
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
Open
Block signups from .shop, .top, and .xyz email TLDs#748kilo-code-bot[bot] wants to merge 1 commit intomainfrom
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
Conversation
These TLDs are being used for free-credit pooling abuse. This adds validation at multiple layers: - Server-side: NextAuth signIn callback (all OAuth providers) - Server-side: magic-link API route (via validateMagicLinkSignupEmail) - Client-side: useSignInFlow hook (instant feedback) Existing users with these TLDs can still sign in. The blocked TLD list is a single constant array (BLOCKED_SIGNUP_TLDS) for easy extension.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Well-structured PR with proper defense-in-depth enforcement of TLD blocking across multiple layers:
Existing users with blocked TLDs are correctly allowed to sign in at every layer. The Files Reviewed (7 files)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.shop,.top, and.xyzemail TLDs to prevent free-credit pooling abuseBLOCKED_SIGNUP_TLDSconstant array insrc/lib/schemas/email.tsfor easy extensionChanges
Validation layers
src/lib/schemas/email.tshasBlockedTLD()utility + integrated intovalidateMagicLinkSignupEmail()andmagicLinkSignupEmailSchemasrc/lib/user.server.tssrc/app/api/auth/magic-link/route.tsvalidateMagicLinkSignupEmail()for new users — picks up TLD check automaticallysrc/hooks/useSignInFlow.tssrc/components/auth/AuthErrorNotification.tsxsrc/lib/auth/constants.tsBLOCKED-TLDtoAuthErrorTypeTests
src/lib/schemas/email.test.ts: 25 new test cases forhasBlockedTLD,validateMagicLinkSignupEmail, andmagicLinkSignupEmailSchemasrc/app/api/auth/magic-link/route.test.ts: 4 new test cases covering blocked TLD rejection for new users and allow-through for existing usersHow to extend
To block additional TLDs, add them to the
BLOCKED_SIGNUP_TLDSarray insrc/lib/schemas/email.ts:All validation layers pick up the change automatically.
Built for John Fawcett by Kilo for Slack