mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 17:32:15 +03:00
a85f5fae35
no issue - fix lint errors in lib/gh-koenig - fix ghost:base eslint errors - update ember plugin refs, remove ember-suave plugin refs - remove old jshint refs - add `lint:js` script - switch to `eslint-plugin-ghost` extending `plugin:ghost/ember`
27 lines
784 B
JavaScript
27 lines
784 B
JavaScript
import RSVP from 'rsvp';
|
|
import SessionService from 'ember-simple-auth/services/session';
|
|
import {computed} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default SessionService.extend({
|
|
feature: service(),
|
|
store: service(),
|
|
tour: service(),
|
|
|
|
user: computed(function () {
|
|
return this.get('store').queryRecord('user', {id: 'me'});
|
|
}),
|
|
|
|
authenticate() {
|
|
return this._super(...arguments).then((authResult) => {
|
|
// TODO: remove duplication with application.afterModel
|
|
let preloadPromises = [
|
|
this.get('feature').fetch(),
|
|
this.get('tour').fetchViewed()
|
|
];
|
|
|
|
return RSVP.all(preloadPromises).then(() => authResult);
|
|
});
|
|
}
|
|
});
|