Ghost/ghost/admin/app/services/session.js

25 lines
554 B
JavaScript
Raw Normal View History

import Ember from 'ember';
import SessionService from 'ember-simple-auth/services/session';
2016-01-19 16:03:27 +03:00
const {
computed,
inject: {service}
} = Ember;
export default SessionService.extend({
2016-01-19 16:03:27 +03:00
store: service(),
feature: service(),
user: computed(function () {
return this.get('store').findRecord('user', 'me');
}),
authenticate() {
return this._super(...arguments).then((authResult) => {
return this.get('feature').fetch().then(() => {
return authResult;
});
});
}
});