Skip to content

samtgarson/nuxt-csrf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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