mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
d78f2611b6
closes #5412 - call this._super() in beforeModel hooks so that simple-auth can handle the transition before we hit any protected API endpoints
23 lines
716 B
JavaScript
23 lines
716 B
JavaScript
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
|
|
|
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
|
titleToken: 'Settings - Labs',
|
|
|
|
classNames: ['settings'],
|
|
|
|
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');
|
|
});
|
|
}
|
|
});
|