mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 03:12:54 +03:00
Ensure settings routes redirect to /signin when not authenticated
closes #5412 - call this._super() in beforeModel hooks so that simple-auth can handle the transition before we hit any protected API endpoints
This commit is contained in:
parent
3061247a7e
commit
42b25a00e3
@ -10,7 +10,9 @@ export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
||||
|
||||
config: Ember.inject.service(),
|
||||
|
||||
beforeModel: function () {
|
||||
beforeModel: function (transition) {
|
||||
this._super(transition);
|
||||
|
||||
if (!this.get('config.apps')) {
|
||||
return this.transitionTo('settings.general');
|
||||
}
|
||||
|
@ -7,7 +7,8 @@ export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
||||
|
||||
classNames: ['settings-view-general'],
|
||||
|
||||
beforeModel: function () {
|
||||
beforeModel: function (transition) {
|
||||
this._super(transition);
|
||||
return this.get('session.user')
|
||||
.then(this.transitionAuthor())
|
||||
.then(this.transitionEditor());
|
||||
|
@ -7,7 +7,8 @@ export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
||||
|
||||
classNames: ['settings'],
|
||||
|
||||
beforeModel: function () {
|
||||
beforeModel: function (transition) {
|
||||
this._super(transition);
|
||||
return this.get('session.user')
|
||||
.then(this.transitionAuthor())
|
||||
.then(this.transitionEditor());
|
||||
|
@ -7,7 +7,8 @@ var NavigationRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings,
|
||||
|
||||
classNames: ['settings-view-navigation'],
|
||||
|
||||
beforeModel: function () {
|
||||
beforeModel: function (transition) {
|
||||
this._super(transition);
|
||||
return this.get('session.user')
|
||||
.then(this.transitionAuthor());
|
||||
},
|
||||
|
@ -14,7 +14,8 @@ paginationSettings = {
|
||||
TagsRoute = AuthenticatedRoute.extend(CurrentUserSettings, PaginationRouteMixin, {
|
||||
titleToken: 'Settings - Tags',
|
||||
|
||||
beforeModel: function () {
|
||||
beforeModel: function (transition) {
|
||||
this._super(transition);
|
||||
return this.get('session.user')
|
||||
.then(this.transitionAuthor());
|
||||
},
|
||||
|
@ -22,7 +22,8 @@ UsersIndexRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings, Pagi
|
||||
this.setupPagination(paginationSettings);
|
||||
},
|
||||
|
||||
beforeModel: function () {
|
||||
beforeModel: function (transition) {
|
||||
this._super(transition);
|
||||
return this.get('session.user')
|
||||
.then(this.transitionAuthor());
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user