Ghost/ghost/admin/initializers/csrf-token.js
2014-06-23 18:35:39 +00:00

14 lines
450 B
JavaScript

var CSRFTokenInitializer = {
name: 'csrf-token',
initialize: function (container, application) {
application.register('csrf:token', $('meta[name="csrf-param"]').attr('content'), { instantiate: false });
application.inject('route', 'csrf', 'csrf:token');
application.inject('model', 'csrf', 'csrf:token');
application.inject('controller', 'csrf', 'csrf:token');
}
};
export default CSRFTokenInitializer;