dfd6d444c3
- fix ember-data complex default value returning in post model - fix mirage returning a user of id 'me' from /user/me
21 lines
579 B
JavaScript
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;
|
|
});
|
|
});
|
|
}
|
|
});
|