mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 03:12:54 +03:00
5e7ff40318
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;
|