Nuxt · Authentication

NUXT0003Mount Better Auth at the standard catch-all route

Checks that Nuxt project code includes the standard auth handler mount needed for predictable behavior.

Why it happens

Nuxt gives this pattern a specific contract. Staying inside that contract makes the code easier to test, refactor, and run across server and client runtimes.

Fix

Add standard auth handler mount where Nuxt expects it, close to the code that depends on it.

Example

Mount Better Auth handler

Before

// server/api/auth/[...all].ts is missing

After

export default defineEventHandler((event) => {
  return auth.handler(toWebRequest(event))
})

Verify the fix

Run only this rule after editing so the report stays focused on the diagnostic you are closing:

pnpm nuxt doctor --rules nuxt-better-auth/require-standard-auth-handler-mount
Copyright © 2026