Sync Convex Better Auth fixes and support Better Auth 1.6.5#217
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
| Name | Type |
|---|---|
| kitcn | Minor |
| @kitcn/resend | Minor |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 165e8fb35e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 909b10b426
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 544f0a9e72
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Addressed: the PR now includes an updated unreleased changeset. The bot comment is stale and still reflects an earlier draft. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85d34f9f3e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c7cc2e78a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20ae262dd5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f83601b54e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e020b50d1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec9f84518e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (originalHost) { | ||
| headers.set('x-forwarded-host', originalHost); |
There was a problem hiding this comment.
Ignore client-supplied forwarded-host override headers
restoreOriginalForwardedHeaders trusts x-better-auth-forwarded-host/proto from the incoming request and copies them into x-forwarded-host/proto without validating the request source. Because these headers are client-controllable on direct requests to the Convex auth endpoint, an attacker can spoof the effective origin seen by Better Auth (for redirects/callback URL construction and related host-based logic), which is a security regression introduced by this proxy-restore path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
an attacker can spoof the effective origin seen by Better Auth ... which is a security regression introduced by this proxy-restore path
Valid concern. I fixed the correctness regressions in this pass, but I’m leaving this thread open because the safe fix needs a real trust boundary for those preserved headers, not a heuristic that only looks secure.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17f483784a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5ddefe8c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10472f72ca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| basePath && basePath !== '/' | ||
| ? basePath.replace(TRAILING_SLASH_RE, '') | ||
| : '/api/auth'; |
There was a problem hiding this comment.
Preserve root basePath when resolving token endpoint
resolveConvexTokenPath currently treats basePath: "/" as the default case and rewrites it to "/api/auth", so token fetches go to /api/auth/convex/token instead of /convex/token. In deployments that intentionally mount Better Auth at root, server-side token refresh will hit the wrong route (404/unauthorized), breaking authenticated Next.js/TanStack Start calls despite an explicit basePath configuration.
Useful? React with 👍 / 👎.
Summary
sync-convex-authaudit skill for fork/upstream review work@convex-dev/better-authto0.11.4registerRouteslazy by default and require explicitbasePathfor non-default auth routesbetter-auth@1.6.5across kitcn, example, docs, and auth fixtures1.6.xcompiles before upstream catches up1.6Where.modeBreaking changes
basePathwhen usingregisterRoutes.1.5.3to1.6.5.Notes
oidc-providerdeprecation warning through@convex-dev/better-auth@0.11.4Verification
bun test packages/kitcn/src/cli/supported-dependencies.test.ts packages/kitcn/src/cli/registry/dependencies.test.tsbun test packages/kitcn/src/auth-client/package-entrypoints.integration.test.tsx packages/kitcn/src/react/auth-mutations.test.tsxbun typecheckbun run fixtures:syncbun run fixtures:checkbun check