zaubererty / ember-cli-django-rest-auth

Auth-Provider for Django-Rest-Framework with Ember-Simple-Auth
GNU Lesser General Public License v3.0
12 stars 5 forks source link

[Ember Observer Score]

Ember CLI - Django Rest-Auth

About

A ember component to authenticate against Django Rest-Framework

Install

npm install ember-cli-django-rest-auth --save-dev

Usage

place your auth settings in your environment.js

if (environment === 'development') {
    ENV.APP.API_HOST = 'http://localhost:8000';
    ENV['simple-auth'] = {
      authorizer: 'authorizer:django-rest',
      serverTokenEndpoint: 'http://localhost:8000/api-token-auth/',
      crossOriginWhitelist: ['http://localhost:8000']
    };

Add following initializer to your app you may call it auth.js:

export default {
  name:       'auth',
  before:      'django-rest-auth',
  initialize: function(container, application){
    window.ENV = <APPNAME>ENV;
  }
};

Authors