Now Playing Mario

    @hicksy/enhance-csrf

    0.5.2 • 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}
      }
    }
    

    Keywords

    none

    Install

    npm i @hicksy/enhance-csrf

    DownloadsWeekly Downloads

    1

    Version

    0.5.2

    License

    Apache-2.0

    Unpacked Size

    13.5 kB

    Total Files

    6

    Last publish

    Collaborators

    • hicksy