@hicksy/enhance-csrf

0.9.0 • Public • Published

CSRF component for Enhance projects

example usage

import { createCsrfToken, verifyCsrfToken } from '@hicksy/enhance-csrf/server/csrf.js'

export let get = [createCsrfToken, two]

export let post = [verifyCsrfToken, two]

async function two (req) {
  console.log('hi from two')
  console.log(req)
  
  return { 
    session: req.session,
    json: {test: 'one', csrf_token: req.session.csrf}
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @hicksy/enhance-csrf

Weekly Downloads

0

Version

0.9.0

License

Apache-2.0

Unpacked Size

14.4 kB

Total Files

6

Last publish

Collaborators

  • hicksy