Skip to content

Plugin for component/model to always send along CSRF headers.

Notifications You must be signed in to change notification settings

segment-boneyard/model-csrf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

model-csrf

Plugin for component/model to always send along CSRF headers.

Installation

Install with component(1):

$ component install segmentio/model-csrf

API

plugin([token])

Adds the token as the proper csrf header. If no token is given, will use window._csrf intead

var Model = require('model');
var csrf = require('model-csrf');

var User = Model('User')
  .use(csrf())
  .attr('email');

License

MIT

About

Plugin for component/model to always send along CSRF headers.

Resources

Stars

Watchers

Forks

Packages

No packages published