2016-06-30 13:21:47 +03:00
|
|
|
import computed from 'ember-computed';
|
|
|
|
import injectService from 'ember-service/inject';
|
2015-10-18 21:17:02 +03:00
|
|
|
import SessionService from 'ember-simple-auth/services/session';
|
|
|
|
|
|
|
|
export default SessionService.extend({
|
2016-06-30 13:21:47 +03:00
|
|
|
store: injectService(),
|
|
|
|
feature: injectService(),
|
2015-10-18 21:17:02 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
user: computed(function () {
|
2017-01-14 00:14:54 +03:00
|
|
|
return this.get('store').queryRecord('user', {id: 'me'});
|
2016-05-05 17:03:09 +03:00
|
|
|
}),
|
|
|
|
|
|
|
|
authenticate() {
|
|
|
|
return this._super(...arguments).then((authResult) => {
|
|
|
|
return this.get('feature').fetch().then(() => {
|
|
|
|
return authResult;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
2015-10-18 21:17:02 +03:00
|
|
|
});
|