@xarenas107/nuxt-uncsrf
TypeScript icon, indicating that this package has built-in type declarations

2.0.5 • Public • Published

Nuxt Unscrf

npm version npm downloads License Nuxt

My new Nuxt module for doing amazing things.

🚀 Features

  • Nuxt 3 ready
  • 👌 Zero config: Configuration for common use cases
  • Nitro ready: Customizable nitro storage.
  • ⚙️ Auto import: Provide auto import functions.
  • 🦾 Type strong: Written in typescript

📦 Install

npm i @xarenas107/nuxt-uncsrf -D 

🦄 Usage

Add @xarenas107/nuxt-uncsrf to the modules section of nuxt.config.ts.

export default defineNuxtConfig({
  modules: [
    '@xarenas107/nuxt-uncsrf'
  ]
})

By default csrf protection is applied to all routes except for /_nuxt and /__nuxt with GET method. If you need more control, use nitro route rules.

Use false to disable protection

routeRules:{
  '/locale/**': {
    uncsrf: false,
  }
}

You can customize storage

// define storage on `nuxt.config.ts`
export default defineNuxtConfig({
  uncsrf:{
    storage:{
      driver:'memory'
    }
  }
})

Or use a previously defined storage'

export default defineNuxtConfig({
  nitro:{
    storage:{
      'security':{
        driver:'memory',
      }
    }
  },
  uncsrf:{
    storage:'security'
  } 
})

That's it! You can now use @nuxt/uncsrf in your Nuxt app ✨

Readme

Keywords

Package Sidebar

Install

npm i @xarenas107/nuxt-uncsrf

Weekly Downloads

0

Version

2.0.5

License

MIT

Unpacked Size

16.2 kB

Total Files

17

Last publish

Collaborators

  • xarenas107