Skip to content

[WIP] CSRF protection for your Nuxt app

License

Notifications You must be signed in to change notification settings

ivarvermeulen/nuxt-csrf

 
 

Repository files navigation

nuxt-csrf CSRF protection for your Nuxt app

Usage

  1. Install the module
  2. You will find your CSRF token in a Vuex store module
  3. Send the token along with any API requests (except: GET|HEAD|OPTIONS|TRACE)

Setup

  • Add nuxt-csrf dependency using yarn or npm to your project
  • Add nuxt-csrf to modules section of nuxt.config.js
{
  modules: [
    // Simple usage
    'nuxt-csrf',

    // With options
    ['nuxt-csrf', {
      sessionName: 'myCSRFSession',
      secretKey: process.env.SECRET_KEY,
      headerName: 'X-MY-CSRF-HEADER'
    }],
 ]
}

About

[WIP] CSRF protection for your Nuxt app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.0%
  • Vue 4.0%