Block Disposable Emails at the Auth0 Registration Layer

The most effective place to stop disposable email abuse is before the account exists. Auth0 Actions let you run custom logic during authentication flows — including user registration.

The Emailyze Auth0 Action checks an email address at the moment of registration and denies account creation if it belongs to a disposable or high-risk provider.

Why the Auth Layer?

Checking email risk in your application code means the account record, session, and welcome email may have already been created by the time you can act on it. Auth0 Actions run synchronously during the OAuth flow — before any of that happens. If the email is disposable, the registration is denied cleanly with an error code your frontend can handle.

How it Works

1. A user submits a registration form (any Auth0-compatible connection) 2. Auth0 fires the Post User Registration trigger 3. The Action calls the Emailyze API with AbortSignal.timeout(3000) 4. If the domain is disposable, masked (when configured), or above your risk threshold, api.access.deny() is called with a descriptive error code 5. If the API is unreachable (timeout or network error), the registration proceeds — fail-open guarantee

Configuration

The Action uses three Auth0 Secrets:

| Secret | Default | Description | |--------|---------|-------------| | EMAILYZE_API_KEY | — | Your Emailyze API key | | EMAILYZE_RISK_THRESHOLD | 80 | Deny registrations with risk scores at or above this value | | EMAILYZE_BLOCK_MASKED | false | Set to true to also block masked emails (Apple Hide My Email, etc.) |

Error Codes

When access is denied, Auth0 surfaces the error code to your frontend:

| Code | Meaning | |------|---------| | disposable_email | Domain is a known disposable provider | | masked_email | Domain is a privacy relay service | | high_risk_email | Risk score exceeds your configured threshold |

You can map these codes to user-friendly messages in your login UI.

Installation

1. Go to Auth0 Dashboard → Actions → Library → Build Custom 2. Select trigger: Post User Registration 3. Paste the action code from auth0-action/block-disposable-email.js 4. Add your secrets under the Secrets tab 5. Click Deploy and then Add to Flow under Actions → Flows → Post User Registration

Get the action code and full setup instructions in the GitHub repository.

Fail-Open Design

The Action is deliberately fail-open: any network error, timeout, or unexpected API response results in the registration being allowed. This prevents a temporary Emailyze outage from locking out all new users. You can monitor the Auth0 Action logs to identify any API errors.