redux-csrf
v1.1.0
Published
Keep your csrf token inside your Redux store.
Downloads
221
Readme
redux-csrf
Keep your csrf token inside your Redux store.
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
).