🛡 Security Module for Nuxt based on HTTP Headers and Middleware
Automatically configure your app to follow OWASP security patterns and principles by using HTTP Headers and Middleware.
This module works with Nuxt 3 only
X-Powered-By header and remove console loggers utils[Optional] Allowed HTTP Methods, Basic Auth, CSRFInstall the module:
npm i -D nuxt-security
yarn add -D nuxt-security
pnpm add -D nuxt-security
Add the module in the modules array in nuxt.config.ts:
export default defineNuxtConfig({
modules: ["nuxt-security"],
})
And that’s it! The module will now register route rules and server middlewares globally so that your application will be more secured.
You can pass configuration to the module in the nuxt.config.ts like following:
export default defineNuxtConfig({
modules: ["nuxt-security"],
security: {
// options
}
})
For all available configuration options check out the docs.
yarn dev:prepare to generate type stubs.yarn dev to start playground in development mode.We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.