2da6673197
supersedes #6773 - update `feature` service and `gh-feature-flag` component to work synchronously rather than async - use the application route's `afterModel` hook so that settings are loaded before first load - override `session` service's `authenticate` method to load the settings after successful authentication before any other routes are processed
25 lines
554 B
JavaScript
25 lines
554 B
JavaScript
import Ember from 'ember';
|
|
import SessionService from 'ember-simple-auth/services/session';
|
|
|
|
const {
|
|
computed,
|
|
inject: {service}
|
|
} = Ember;
|
|
|
|
export default SessionService.extend({
|
|
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;
|
|
});
|
|
});
|
|
}
|
|
});
|