0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00
ghost/core/client/routes/posts/index.js
Matt Enlow 065cbc569d Change posts, post and signout routes to be AuthenticatedRoutes
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`
2014-06-13 14:13:07 -06:00

14 lines
389 B
JavaScript

import AuthenticatedRoute from 'ghost/routes/authenticated';
var PostsIndexRoute = AuthenticatedRoute.extend({
// redirect to first post subroute
redirect: function () {
var firstPost = (this.modelFor('posts') || []).get('firstObject');
if (firstPost) {
this.transitionTo('posts.post', firstPost);
}
}
});
export default PostsIndexRoute;