1.1.0 • Published 8 years ago

redux-csrf v1.1.0

Weekly downloads
32
License
MIT
Repository
github
Last release
8 years ago

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