feat: block registration/sign-in from .shop/.top TLDs#750
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge OverviewThis PR adds TLD-based blocking for new user signups across both the magic-link and OAuth (Google) authentication flows. The implementation is clean and consistent:
Previous review comments have been addressed or dismissed by the repo owner. Files Reviewed (4 files)
|
jrf0110
commented
Mar 3, 2026
…LIST_TLDS env var Add TLD-based email blocking alongside the existing BLACKLIST_DOMAINS mechanism. The BLACKLIST_TLDS env var uses the same pipe-delimited format (e.g. "shop|top") and is enforced at the signIn callback, magic-link route, and user authorization.
Move TLD check after the existing-user lookup so returning users with blocked TLDs can still sign in. Remove TLD check from validateUserAuthorization to avoid locking out existing sessions.
Expect BLACKLIST_TLDS entries to include the leading dot (e.g. ".shop|.top|.co.uk"). This naturally supports multi-part TLDs without special parsing logic.
e4a6db8 to
2232e26
Compare
jrf0110
commented
Mar 3, 2026
markijbema
reviewed
Mar 3, 2026
| 'SECURITY_CLEANUP_BETTERSTACK_HEARTBEAT_URL' | ||
| ); | ||
|
|
||
| // Pipe-delimited list of TLDs to block from new signups, each with a leading dot (e.g. ".shop|.top|.co.uk") |
Contributor
Author
Contributor
Author
There was a problem hiding this comment.
In all seriousness, we are not blocking .co.uk but it was just an example the agent put in there
markijbema
approved these changes
Mar 3, 2026
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
BLACKLIST_TLDSenv var (pipe-delimited, e.g.shop|top), matching the existingBLACKLIST_DOMAINSpatternsignIncallback, magic-link API route, andvalidateUserAuthorizationfor existing sessionsDeployment
Set the
BLACKLIST_TLDSenvironment variable in production: