Skip to content

Roll Better Auth back to 1.6 so MCP clients can register - #218

Merged
wasimxyz merged 3 commits into
stagingfrom
revert/better-auth-1.6
Sep 1, 2026
Merged

Roll Better Auth back to 1.6 so MCP clients can register#218
wasimxyz merged 3 commits into
stagingfrom
revert/better-auth-1.6

Conversation

@wasimxyz

@wasimxyz wasimxyz commented Sep 1, 2026

Copy link
Copy Markdown
Member

Why

Better Auth 1.7, shipped in #216, rejects the OAuth client registration that both Cursor and Claude Code send. They leave out application_type, so 1.7 treats them as browser apps and demands an https:// callback on a real host. Cursor sends cursor://anysphere.cursor-mcp/oauth/callback. Claude Code sends http://localhost:3118/callback. Both get a 400 and never reach the sign-in page.

Production is still on 1.6.27, which is why those same clients still work there. The upstream option that would accept these clients (clientRegistrationDefaultApplicationType: "infer" in better-auth#10956) is not in 1.7.2.

What this does

Pins better-auth and @better-auth/oauth-provider to 1.6.27 and restores the 1.6 provider settings (validAudiences, verifyAccessToken).

Keeps the unrelated work from #216: the wide-table scrolling fix, comment counts, the deleted-run badge refactor, the make check rename, and the pyright bump.

Leaves migrations 0043 and 0044 in place (they already ran on staging). Adds 0045, which drops the account.issuer NOT NULL constraint and the unique index so Better Auth 1.6 can insert new account rows.

Risk

Going back to 1.6.27 reopens GHSA-p2fr-6hmx-4528. The single-audience allow-list (validAudiences) is the same mitigation the repo used before the upgrade.

Do not promote staging to production until this lands.

Test plan

  • make check
  • Frontend unit tests (360) and integration tests (390)
  • Local sign-in as alice@example.com
  • Claude-style and Cursor-style client registration against localhost both return 200
  • claude mcp add for local reports "Needs authentication" instead of the https-callback error
  • After merge: confirm apply-migrations applied 0045
  • After merge: reconnect Cursor staging and claude mcp login data-hub-staging

Made with Cursor

1.7 rejects Cursor and Claude Code because both omit application_type
and send a non-https callback. Pin the packages to 1.6.27 and add a
migration that lets 1.6 insert account rows again. Leave the UI and
make-check work from #216 in place.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
data-hub Ready Ready Preview Sep 1, 2026 10:16pm UTC

Request Review

Next 16 treats the git repo as the Turbopack workspace, so make dev
already running in web/ wrote assets to web/web/.next. Pin the app
root and ignore any leftover copy.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keeps client assets in web/.next so a leftover cache cannot
restore them into web/web/.next on make dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
@wasimxyz
wasimxyz merged commit 6cb0afa into staging Sep 1, 2026
4 checks passed
@wasimxyz
wasimxyz deleted the revert/better-auth-1.6 branch September 1, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant