mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 12:21:36 +03:00
f5dc5adcdd
Closes #4357 - Adds a call to `this._super()` in DebugRoute#beforeModel to hit the ember simpleauth mixin's beforemodel hook
28 lines
795 B
JavaScript
28 lines
795 B
JavaScript
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
|
|
|
var DebugRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, {
|
|
classNames: ['settings'],
|
|
|
|
beforeModel: function (transition) {
|
|
this._super(transition);
|
|
|
|
var self = this;
|
|
this.store.find('user', 'me').then(function (user) {
|
|
if (user.get('isAuthor') || user.get('isEditor')) {
|
|
self.transitionTo('posts');
|
|
}
|
|
});
|
|
},
|
|
|
|
model: function () {
|
|
return this.store.find('setting', {type: 'blog,theme'}).then(function (records) {
|
|
return records.get('firstObject');
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
export default DebugRoute;
|