superagent-rails-csrf

Set CSRF Token as X-CSRF-Token header to superagent requests.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
superagent-rails-csrf
200.0.27 years ago7 years agoMinified + gzip package size for superagent-rails-csrf in KB

Readme

superagent-rails-csrf
Set CSRF Token as X-CSRF-Token header to superagent requests. CSRF Token is created by Rails, and get token from meta tag (generated by csrf_meta_tags helper).
Usage
var request = require('superagent');
require('superagent-rails-csrf')(request);

request
  .post('/blogs/1/like')
  .setCsrfToken()
  .end(function (err, res) {
    ...
  });