mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 11:34:24 +03:00
42b25a00e3
closes #5412 - call this._super() in beforeModel hooks so that simple-auth can handle the transition before we hit any protected API endpoints
29 lines
779 B
JavaScript
29 lines
779 B
JavaScript
import Ember from 'ember';
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
|
titleToken: 'Apps',
|
|
|
|
classNames: ['settings-view-apps'],
|
|
|
|
config: Ember.inject.service(),
|
|
|
|
beforeModel: function (transition) {
|
|
this._super(transition);
|
|
|
|
if (!this.get('config.apps')) {
|
|
return this.transitionTo('settings.general');
|
|
}
|
|
|
|
return this.get('session.user')
|
|
.then(this.transitionAuthor())
|
|
.then(this.transitionEditor());
|
|
},
|
|
|
|
model: function () {
|
|
return this.store.find('app');
|
|
}
|
|
});
|