mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Merge pull request #2953 from novaugust/authenticate-ember-routes
Change `posts`, `post`, and `signout` routes to be `AuthenticatedRoute`s
This commit is contained in:
commit
b9c6a8bbcb
@ -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: function () {
|
||||
var firstPost = (this.modelFor('posts') || []).get('firstObject');
|
||||
|
@ -1,4 +1,6 @@
|
||||
var PostsPostRoute = Ember.Route.extend({
|
||||
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
||||
|
||||
var PostsPostRoute = AuthenticatedRoute.extend({
|
||||
model: function (params) {
|
||||
var post = this.modelFor('posts').findBy('id', params.post_id);
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
import ajax from 'ghost/utils/ajax';
|
||||
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'],
|
||||
|
||||
beforeModel: function () {
|
||||
|
Loading…
Reference in New Issue
Block a user