Errors

NUXT_AUTH_SCHEMA_STORAGE_REQUIRED: Custom session storage is missing

Provide secondaryStorage or retain the session table when generating the auth schema.
Example error
[NUXT_AUTH_SCHEMA_STORAGE_REQUIRED] hubSecondaryStorage: "custom" requires secondaryStorage in defineServerAuth() to omit the session table from the generated schema.

Why this happens

The schema generator was asked to omit the session table with hubSecondaryStorage: "custom", but defineServerAuth() did not provide secondaryStorage. Development warns and retains the session table; production setup fails.

How to fix it

Provide an atomic secondaryStorage in defineServerAuth(), or set auth.hubSecondaryStorage to false to keep database-backed sessions.

If you want database-backed sessions, keep the session table:

nuxt.config.ts
export default defineNuxtConfig({
  auth: { hubSecondaryStorage: false },
})

If you intend to use custom session storage, keep 'custom' and supply a Better Auth secondary store with atomic getAndDelete and increment operations in defineServerAuth(). Review the generated schema before applying a migration that changes session storage.

Verify the fix

Regenerate the schema. With hubSecondaryStorage: false, confirm the session table is present before creating a database migration.

See Configure secondary storage or return to the error reference.