[PR #7935] [MERGED] fix(sso): resolve TXT record at verification subdomain instead of root domain #7636

Closed
opened 2026-03-13 13:43:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7935
Author: @Paola3stefania
Created: 2/12/2026
Status: Merged
Merged: 2/12/2026
Merged by: @himself65

Base: canaryHead: fix/sso-domain-verification-dns-lookup


📝 Commits (4)

📊 Changes

5 files changed (+90 additions, -24 deletions)

View changed files

📝 docs/content/docs/plugins/sso.mdx (+3 -3)
📝 packages/sso/src/domain-verification.test.ts (+46 -4)
📝 packages/sso/src/routes/domain-verification.ts (+34 -12)
📝 packages/sso/src/routes/sso.ts (+2 -3)
📝 packages/sso/src/types.ts (+5 -2)

📄 Description

Summary by cubic

Fixes SSO domain verification by resolving TXT on a verification subdomain instead of the root domain. Adopts an underscore-prefixed identifier per RFC 8552 and adds a DNS label length check.

  • Bug Fixes
    • Resolve TXT at "_-." instead of the root domain.
    • Enforce identifier length <= 63; return 400 with code IDENTIFIER_TOO_LONG.
    • Centralize identifier generation via getVerificationIdentifier; underscore is added automatically; default tokenPrefix is "better-auth-token".
    • Update docs and tests for underscore-prefixed subdomains, custom prefixes, and long provider IDs.

Written for commit eb935656e9. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7935 **Author:** [@Paola3stefania](https://github.com/Paola3stefania) **Created:** 2/12/2026 **Status:** ✅ Merged **Merged:** 2/12/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/sso-domain-verification-dns-lookup` --- ### 📝 Commits (4) - [`98fb7f7`](https://github.com/better-auth/better-auth/commit/98fb7f7220855c1497ae8d8bf1ed17af9c0fb5d4) fix dns lookup - [`aa7ec87`](https://github.com/better-auth/better-auth/commit/aa7ec87f738f6b44e86259bee9b816dc329798dc) make lint happy - [`9dbc3a8`](https://github.com/better-auth/better-auth/commit/9dbc3a814be75adf4896ded6bd82c4b2af0f346f) make biome happy - [`eb93565`](https://github.com/better-auth/better-auth/commit/eb935656e934743adda70e6d693a2ad356dc669c) rfc 8552 underscore prefix ### 📊 Changes **5 files changed** (+90 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/sso.mdx` (+3 -3) 📝 `packages/sso/src/domain-verification.test.ts` (+46 -4) 📝 `packages/sso/src/routes/domain-verification.ts` (+34 -12) 📝 `packages/sso/src/routes/sso.ts` (+2 -3) 📝 `packages/sso/src/types.ts` (+5 -2) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes SSO domain verification by resolving TXT on a verification subdomain instead of the root domain. Adopts an underscore-prefixed identifier per RFC 8552 and adds a DNS label length check. - **Bug Fixes** - Resolve TXT at "_<tokenPrefix>-<providerId>.<hostname>" instead of the root domain. - Enforce identifier length <= 63; return 400 with code IDENTIFIER_TOO_LONG. - Centralize identifier generation via getVerificationIdentifier; underscore is added automatically; default tokenPrefix is "better-auth-token". - Update docs and tests for underscore-prefixed subdomains, custom prefixes, and long provider IDs. <sup>Written for commit eb935656e934743adda70e6d693a2ad356dc669c. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:43:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#7636