Ghost/ghost/admin/app/instance-initializers/authentication.js
Austin Burdine 8332201026 updates Ember-CLI to 0.2.7
No issue
- moves the authentication initializer to be an instance initializer
- updates dependencies
- fixes error with asset-delivery not copying
- fixes problem with testing by re-building ember before casper tests
2015-06-08 09:18:50 -04:00

27 lines
761 B
JavaScript

import Ember from 'ember';
var AuthenticationInitializer = {
name: 'authentication',
initialize: function (instance) {
var store = instance.container.lookup('store:main'),
Session = instance.container.lookup('simple-auth-session:main'),
OAuth2 = instance.container.lookup('simple-auth-authenticator:oauth2-password-grant');
Session.reopen({
user: Ember.computed(function () {
return store.find('user', 'me');
})
});
OAuth2.reopen({
makeRequest: function (url, data) {
data.client_id = 'ghost-admin';
return this._super(url, data);
}
});
}
};
export default AuthenticationInitializer;