Namespace, Primitive, Method

    superagent-rails-csrf

    0.0.2 • Public • Published

    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) {
        ...
      });

    Keywords

    none

    Install

    npm i superagent-rails-csrf

    DownloadsWeekly Downloads

    2,253

    Version

    0.0.2

    License

    MIT

    Last publish

    Collaborators

    • dex1t