feat(auth): add first-class Nuxt integration - #214
Conversation
Provide Vue client and Nitro server adapters so Nuxt apps can use Neon Auth with the same framework-native surface as Next.js.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Keep Vue clients out of the React provider contract and trim duplicated Nuxt docs and adapter test scaffolding.
Use direct technical wording across the new Nuxt docs and remove Oxford commas from the added prose.
Shridhad
left a comment
There was a problem hiding this comment.
The Nuxt implementation does reuse the extracted @neondatabase/auth/server toolkit correctly: RequestContext, createAuthServer, handleAuthProxyRequest, processAuthMiddleware, validation, and logging remain shared rather than being copied. The H3 bridge also handles raw bodies and separate Set-Cookie values carefully, and the explicit event binding has a good concurrency test.
The main blocker is the route-protection default. Unlike Hono PR #202, where middleware is scoped to a protected route, Nitro middleware is global and this defaults to protecting every path. That can redirect Nuxt assets and nominally public server routes. The docs currently encourage using auth.middleware() without showing a safe protectedRoutes configuration, and the missing example means there is no integration artifact demonstrating the intended wiring.
I also think we should make an explicit API decision before calling Nuxt a reference adapter: Next and Hono return the NeonAuthServer proxy directly and attach .handler() / .middleware(), while Nuxt returns { withEvent, handler, middleware }. Explicit event binding is safe, but it means future framework adapters cannot follow one consistent application-facing pattern. If Nitro request context cannot safely support the same surface, documenting this as a deliberate Nuxt-specific exception is reasonable.
Requested changes: make the middleware default safe (or explicitly exclude framework assets and document whole-app protection), add real middleware wiring tests, and either include the referenced Nuxt example or remove the broken link and provide complete setup snippets.
Show the Nuxt adapter with Nuxt UI auth flows, organizations, user-scoped notes and shared E2E coverage.
Keep global Nitro middleware safe by default, document explicit event binding and cover public and protected route wiring.
Avoid matching Nuxt UI password visibility controls in shared auth helpers.
Use the accessible label when available and fall back to the Better Auth UI placeholder.
Shridhad
left a comment
There was a problem hiding this comment.
Follow-up looks good. The previous blockers are addressed: route protection is opt-in, middleware wiring tests cover the Nuxt-specific paths, the example is in-tree with handler/middleware/withEvent docs, and withEvent is documented as a Nuxt-specific exception rather than a new adapter template. Unit tests plus React/Next/Nuxt E2E are green.
The adapter still sits on the shared toolkit correctly. Two leftover nits below, neither blocking.
Match the Nuxt middleware docs to the example and skip unsupported organization views only for the Nuxt target.
Summary
@neondatabase/auth/nuxtclient@neondatabase/neon-jsTest plan
@neondatabase/auth,@neondatabase/auth-ui,@neondatabase/neon-jsand the Nuxt example