Skip to content

fix: preserve auth client facade in Pinia stores#338

Merged
onmax merged 3 commits intomainfrom
codex/fix-pinia-auth-client
May 4, 2026
Merged

fix: preserve auth client facade in Pinia stores#338
onmax merged 3 commits intomainfrom
codex/fix-pinia-auth-client

Conversation

@onmax
Copy link
Copy Markdown
Collaborator

@onmax onmax commented May 4, 2026

Fixes the Pinia forwarding regression from PR #295 where useUserSession().client could be returned from a setup store as authClient and Pinia would classify it as an action.

The root cause is that Better Auth’s Vue client root is a callable proxy. The module facade now exposes a non-callable, Vue-raw root object while preserving callable dynamic nested paths such as sendVerificationEmail, signIn.email, and plugin client methods.

This keeps the public useUserSession().client API intact and makes the runtime shape match the docs/types: the client root is not callable, but client methods remain callable.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 4, 2026

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

Project Deployment Actions Updated (UTC)
nuxt-better-auth-docs Ready Ready Preview, Comment May 4, 2026 2:26pm

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 4, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@onmax/nuxt-better-auth@338

commit: f040c68

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 4, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
better-auth f040c68 May 04 2026, 02:24 PM

@onmax onmax marked this pull request as ready for review May 4, 2026 14:35
@onmax onmax merged commit 364bd3d into main May 4, 2026
5 of 6 checks passed
@onmax onmax deleted the codex/fix-pinia-auth-client branch May 4, 2026 14:35
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