mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
0322de36ee
related issue #5412 - code-injection route was overriding `beforeModel` without calling `super` which meant the redirect handling added in `AuthenticatedRoute` was being skipped
27 lines
845 B
JavaScript
27 lines
845 B
JavaScript
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: 'Settings - Code Injection',
|
|
classNames: ['settings-view-code'],
|
|
|
|
beforeModel: function (transition) {
|
|
this._super(transition);
|
|
return this.get('session.user')
|
|
.then(this.transitionAuthor())
|
|
.then(this.transitionEditor());
|
|
},
|
|
|
|
model: function () {
|
|
return this.store.find('setting', {type: 'blog,theme'}).then(function (records) {
|
|
return records.get('firstObject');
|
|
});
|
|
},
|
|
|
|
actions: {
|
|
save: function () {
|
|
this.get('controller').send('save');
|
|
}
|
|
}
|
|
});
|