Ghost/ghost/admin/app/services/session.js
Austin Burdine dfd6d444c3 fix test warnings (#492)
- fix ember-data complex default value returning in post model
- fix mirage returning a user of id 'me' from /user/me
2017-01-13 21:14:54 +00:00

21 lines
579 B
JavaScript

import computed from 'ember-computed';
import injectService from 'ember-service/inject';
import SessionService from 'ember-simple-auth/services/session';
export default SessionService.extend({
store: injectService(),
feature: injectService(),
user: computed(function () {
return this.get('store').queryRecord('user', {id: 'me'});
}),
authenticate() {
return this._super(...arguments).then((authResult) => {
return this.get('feature').fetch().then(() => {
return authResult;
});
});
}
});