Ninety-nine Pitchers of Malt

    redux-csrf

    1.1.0 • Public • Published

    redux-csrf

    Keep your csrf token inside your Redux store.

    Travis Codecov Status npm package npm downloads license

    Dependency Status devDependency Status peerDependency Status

    Installation

    $ npm install redux-csrf --save

    Usage

    import { default as reducer, actions } from 'redux-csrf';
     
    // Server side with csurf middleware
    store.dispatch(actions.setCsrfToken(req.csrfToken()));
     
    // Reducer
    combineReducers({
      ...otherReducers
      _csrf: reducer,
    });

    API

    setCsrfToken(token)

    Set CSRF token to redux store.

    Test

    $ npm run lint
    $ npm run test:watch
    

    CONTRIBUTING

    • ⇄ Pull requests and ★ Stars are always welcome.
    • For bugs and feature requests, please create an issue.
    • Pull requests must be accompanied by passing automated tests ($ npm test).

    CHANGELOG

    LICENSE

    MIT: http://michaelhsu.mit-license.org

    Keywords

    Install

    npm i redux-csrf

    DownloadsWeekly Downloads

    26

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • evenchange4