Git Product home page Git Product logo

ember-django-csrf's Introduction

Ember Django CSRF

Build Status Code Climate Dependency Status Ember Observer Score

Add Django based CSRF protection to your Ember application.

This addon requires a meta tag named X-CSRFToken provided within index.html file. You can use Django Ember Index as a provider of the index.html file.

Installation

  • ember install ember-django-csrf

The CSRF protection is enabled by default on every AJAX request with X-CSRFToken header. You can specify an URL pattern in config/environment.js to protect only a subset of requests.

var ENV = {
  ...
  django: {
    csrf: '^api'
  }
};

License

Ember Django CSRF is available under the MIT license. See the LICENSE file for more info.

ember-django-csrf's People

Contributors

bobisjan avatar ember-tomster avatar

Stargazers

Maxim Avanov avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

iftahh

ember-django-csrf's Issues

not compatible with ember 2.3

throws error: "instance.container.lookupFactory is not a function"

Instead of:

var config = instance.container.lookupFactory('config:environment');

I think we need to do something like

var config = instance.lookup('config:environment');

default export - ie7

using ember-django-csrf resulted in the following js (compiled by ember-cli version: 0.2.7)

define('agent/instance-initializers/django-csrf', ['exports', 'ember-django-csrf/instance-initializers/django-csrf'], function (exports, django_csrf) {

    'use strict';

    exports.default = django_csrf.default;
    exports.initialize = django_csrf.initialize;
});

the line exports.default = ... causes IE7 to throw an exception. The rest of the Ember modules generate a correct syntax exports['default'] = ....

This is probably a fault of the ember-cli, but if you can provide a work-around that would be great since I need to support IE7 :(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.