The module enables authentication by default. To test APIs without authentication, you can set auth: false.
Requires nuxt-auth-utils and nuxt-authorization.
export default defineNuxtConfig({
autoCrud: {
auth: {
type: 'session',
authentication: true, // Enables requireUserSession() check
authorization: true // Enables authorize(model, action) check
}
}
})
Useful for backend-only apps.
export default defineNuxtConfig({
autoCrud: {
auth: {
type: 'jwt',
authentication: true,
jwtSecret: process.env.JWT_SECRET,
authorization: true
}
}
})