mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Change posts
, post
and signout
routes to be AuthenticatedRoute
s
No issue The following is a list of routes which are not authenticated - placeholder routes: `editor` and `content` - `application` - password routes: `forgotten`, `reset`, `signin`, `signup`
This commit is contained in:
parent
beb409dd5f
commit
57641cffe4
3 changed files with 11 additions and 6 deletions
|
@ -1,4 +1,6 @@
|
||||||
var PostsIndexRoute = Ember.Route.extend({
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||||
|
|
||||||
|
var PostsIndexRoute = AuthenticatedRoute.extend({
|
||||||
// redirect to first post subroute
|
// redirect to first post subroute
|
||||||
redirect: function () {
|
redirect: function () {
|
||||||
var firstPost = (this.modelFor('posts') || []).get('firstObject');
|
var firstPost = (this.modelFor('posts') || []).get('firstObject');
|
||||||
|
@ -9,4 +11,4 @@ var PostsIndexRoute = Ember.Route.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default PostsIndexRoute;
|
export default PostsIndexRoute;
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
var PostsPostRoute = Ember.Route.extend({
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||||
|
|
||||||
|
var PostsPostRoute = AuthenticatedRoute.extend({
|
||||||
model: function (params) {
|
model: function (params) {
|
||||||
var post = this.modelFor('posts').findBy('id', params.post_id);
|
var post = this.modelFor('posts').findBy('id', params.post_id);
|
||||||
|
|
||||||
|
@ -10,4 +12,4 @@ var PostsPostRoute = Ember.Route.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default PostsPostRoute;
|
export default PostsPostRoute;
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import ajax from 'ghost/utils/ajax';
|
import ajax from 'ghost/utils/ajax';
|
||||||
import styleBody from 'ghost/mixins/style-body';
|
import styleBody from 'ghost/mixins/style-body';
|
||||||
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||||
|
|
||||||
var SignoutRoute = Ember.Route.extend(styleBody, {
|
var SignoutRoute = AuthenticatedRoute.extend(styleBody, {
|
||||||
classNames: ['ghost-signout'],
|
classNames: ['ghost-signout'],
|
||||||
|
|
||||||
beforeModel: function () {
|
beforeModel: function () {
|
||||||
|
@ -24,4 +25,4 @@ var SignoutRoute = Ember.Route.extend(styleBody, {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default SignoutRoute;
|
export default SignoutRoute;
|
||||||
|
|
Loading…
Add table
Reference in a new issue