feat: Add support for default custom domain and deprecation warning for enable_custom_domain_in_emails #1330
Merged
kushalshit27 merged 11 commits intomasterfrom Apr 10, 2026
Merged
feat: Add support for default custom domain and deprecation warning for enable_custom_domain_in_emails #1330kushalshit27 merged 11 commits intomasterfrom
kushalshit27 merged 11 commits intomasterfrom
Conversation
…or enable_custom_domain_in_emails
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1330 +/- ##
==========================================
+ Coverage 80.06% 80.10% +0.03%
==========================================
Files 152 152
Lines 6196 6212 +16
Branches 1286 1290 +4
==========================================
+ Hits 4961 4976 +15
- Misses 701 702 +1
Partials 534 534 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kushalshit27
approved these changes
Apr 10, 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.
Context
The Auth0 Management API is introducing a new default custom domain concept as part of the Multiple Custom Domains (MCD) GA release. Tenants can now designate one of their verified custom domains as the default, this domain is used in email/phone notification links (e.g. password reset, email verification) when no explicit
auth0-custom-domainheader is sent by the API client.Two new Management API endpoints are being introduced:
GET /api/v2/custom-domains/default, returns the current default domainPATCH /api/v2/custom-domains/default, sets the default domainThis PR implements Deploy CLI support for both changes ahead of the API going live.
🔧 Changes
src/tools/auth0/handlers/customDomains.tsis_defaultas an optional boolean field to the custom domain JSON schema so it can be declared in YAML configsis_defaultremains instripCreateFieldsandstripUpdateFields, the regularPATCH /api/v2/custom-domains/{id}endpoint rejects it as read-only per the RFC, it can only be set via the dedicated default endpointsetDefaultDomain()private method that callsPATCH /api/v2/custom-domains/defaultdirectly since this endpoint is not yet available in the auth0 Node.js SDK. The method reuses the SDK client's internal auth provider (_options.authProvider) via type assertion to avoid duplicating token management logicprocessChangesnow callssetDefaultDomain()after the normal create/update/delete cycle completes, if any domain in the config hasis_default: truesrc/tools/auth0/handlers/tenant.tsenable_custom_domain_in_emailsis found in tenant flags, guiding users to migrate to theis_defaultfield on customDomainsallowedTenantFlagssince it hasn't been removed from the API yetexamples/yaml/tenant.yamlis_default: trueto the custom domain example to document the new fieldtest/tools/auth0/handlers/customDomains.test.tsglobalThis.fetch, sinceis_default: truein the test data now triggers thesetDefaultDomaincall📚 References
🔬 Testing
Unit tests
is_defaultis correctly stripped from both create and update API payloadssetDefaultDomainis triggered whenis_default: trueis present in the configManual testing against a real tenant
is_defaultonGET /api/v2/custom-domainsresponses - the field is liveis_default: truesetDefaultSDK call successfully reachedPATCH /api/v2/custom-domains/defaultwith the correct payloadGET /api/v2/custom-domainsafter the import that the target domainwas set as the default - full end-to-end flow verified
📝 Checklist