Ghost/core/client/routes/posts.js
Sebastian Gierlinger c8e8da4780 oAuth
closes #2759
closes #3027

- added oauth2orize library for server side oAuth handling
- added ember-simple-auth library for admin oAuth handling
- added tables for client, accesstoken and refreshtoken
- implemented RFC6749 4.3 Ressouce Owner Password Credentials Grant
- updated api tests with oAuth
- removed session, authentication is now token based

Known issues:
- Restore spam prevention #3128
- Signin after Signup #3125
- Signin validation #3125

**Attention**
- oldClient doesn't work with this PR anymore, session authentication
was
removed
2014-06-30 14:58:10 +02:00

46 lines
1.3 KiB
JavaScript

import styleBody from 'ghost/mixins/style-body';
import ShortcutsRoute from 'ghost/mixins/shortcuts-route';
import loadingIndicator from 'ghost/mixins/loading-indicator';
var paginationSettings = {
status: 'all',
staticPages: 'all',
include: 'tags',
page: 1
};
var PostsRoute = Ember.Route.extend(Ember.SimpleAuth.AuthenticatedRouteMixin, ShortcutsRoute, styleBody, loadingIndicator, {
classNames: ['manage'],
model: function () {
// using `.filter` allows the template to auto-update when new models are pulled in from the server.
// we just need to 'return true' to allow all models by default.
return this.store.filter('post', paginationSettings, function () {
return true;
});
},
setupController: function (controller, model) {
this._super(controller, model);
controller.set('paginationSettings', paginationSettings);
},
shortcuts: {
'up': 'moveUp',
'down': 'moveDown'
},
actions: {
openEditor: function (post) {
this.transitionTo('editor.edit', post);
},
moveUp: function () {
window.alert('@todo keyboard post navigation: up');
},
moveDown: function () {
window.alert('@todo keyboard post navigation: down');
}
}
});
export default PostsRoute;