feat: implement authentication, user management endpoints, and automated disposable email blocklist synchronization#59
Merged
Conversation
…ted disposable email blocklist synchronization
|
✅ PR Validation Passed Your PR title and description meet all requirements:
|
3 similar comments
|
✅ PR Validation Passed Your PR title and description meet all requirements:
|
|
✅ PR Validation Passed Your PR title and description meet all requirements:
|
|
✅ PR Validation Passed Your PR title and description meet all requirements:
|
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
This PR introduces a robust, three-layer defense to block temporary and disposable email addresses from registering on the platform. It replaces the basic syntax check with a fast, offline verification against a comprehensive 72,000+ domain blocklist. Additionally, it resolves several Mongoose deprecation warnings (
new: truereplaced withreturnDocument: 'after') across multiple API routes.Related issue
Fixes #58
Changes
lib/emailGuard.tsto handle disposable email validation using a multi-layer approach (local blocklist + hardcoded recent bypassers + DNS MX fallback).lib/disposable-domains.jsoncontaining a merged list of 72,266 known disposable domains pulled from community GitHub repositories./api/admin/refresh-email-blocklist) protected byADMIN_SECRETto fetch fresh blocklists and hot-reload them into memory without a server restart./api/auth/signup/route.tsto intercept and reject signups using temporary emails before generating or sending OTPs..envto include theADMIN_SECRETvariable.new: truedeprecation warnings in the following routes by updating them to usereturnDocument: 'after':app/api/auth/login/route.tsapp/api/auth/signup/route.tsapp/api/auth/otp/send/route.tsapp/api/users/approve/route.tsapp/api/users/update/route.tsapp/api/users/keybinds/route.tsTesting
mailinator.com,guerrillamail.com) are instantly blocked with a400status and user-friendly message.minitts.net,123mails.org,ruutukf.com) are correctly identified and blocked.gmail.com,outlook.com,yahoo.com) successfully pass the validation and proceed to OTP generation./api/admin/refresh-email-blocklistendpoint with the correctx-admin-secretsuccessfully fetches and hot-reloads the latest blocklist.Checklist
Fixes #58