Sign-up restrictions
An application can limit who signs up with two lists of identifiers: an allowlist and a blocklist. Each list has its own switch, off by default, and each application (development and production) has its own lists. Both are on the Free and the Pro plan. Manage them in the dashboard, on the application’s Restrictions page, or with the Backend API.
What an entry can be
Section titled “What an entry can be”| Form | Example | Matches |
|---|---|---|
| Exact email | ada@example.com |
that address |
| Domain | example.com or *@example.com |
every address at example.com, nothing under it |
| Subdomains | *@*.example.com |
ada@mail.example.com, ada@a.b.example.com, but not ada@example.com |
A domain entry is stored as example.com. To cover a domain and everything under it, add both example.com and
*@*.example.com. Any other wildcard (ada@*.com, *.example.com, ex*@example.com) is refused with 400
validation_failed when you add it. Entries are case-insensitive, and an
internationalized domain matches its punycode form: bücher.de and xn--bcher-kva.de are the same entry, for the
list and for the address a user types. An email entry must be on a valid hostname; ada@ex_ample.com cannot be listed,
so cover such an address with a parent *@*. entry instead. A list holds up to 1,000
entries; adding the same one twice fails with
restriction_identifier_exists.
How the lists decide
Section titled “How the lists decide”- Allowlist on: only an address that matches an allowlist entry can sign up. The blocklist is not read. An allowlist that is on and empty blocks every sign-up, and the dashboard warns you while that is the case.
- Allowlist off, blocklist on: an address that matches a blocklist entry cannot sign up.
- Both on: the allowlist wins. An address on both lists can sign up, and an address on neither cannot.
- A list that is off is never read; its entries are kept for when you turn it on.
A +tag in the local part is ignored only when matching the blocklist: with ada@example.com blocked, ada+news@example.com is
blocked too. The allowlist matches the address as typed, so an allowlisted ada@example.com does not admit
ada+news@example.com.
Where they apply
Section titled “Where they apply”The lists apply when an address comes into an account through the Frontend API: when a user signs up (with a password, a social provider’s email, or an invitation’s ticket), and when a signed-in user adds an email address to an existing account. The check runs again when a sign-up completes, so a list changed while a user was typing the code still counts.
For an address typed into a form, the answer depends only on the address. On a social sign-up the account match runs first: a provider identity that is already linked to an account signs in and is not checked.
They do not apply to:
- Signing in. A user whose address is now blocked can still sign in. To stop an existing user, ban them in the
dashboard or with
users.ban(user_banned). - Users created with the Backend API or the dashboard. You decide for those.
- Impersonation.
A refused address fails with 422 identifier_not_allowed, on the
email_address field (or ticket, token). The message does not say which list refused it, and the answer depends
only on the address, never on whether it already has an account, so the form cannot be used to find out who is a
user. The prebuilt components show it under the email field; a social sign-up has no field, so the message shows on
the form.
From your server
Section titled “From your server”import { createZauthaClient } from "@zautha/backend";
const zautha = createZauthaClient({ secretKey: process.env.ZAUTHA_SECRET_KEY! });
await zautha.allowlistIdentifiers.create({ identifier: "acme.com" });await zautha.allowlistIdentifiers.create({ identifier: "*@*.acme.com" });await zautha.instance.updateRestrictions({ allowlist: true });Every change to a list or a switch is recorded in the audit log, without the address itself. There are no webhooks for the lists.