mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
8332201026
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
27 lines
761 B
JavaScript
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;
|