Ghost/core/client/routes/signout.js
Matt Enlow b04dfd52c1 Cleanup Misc Ember Code
No issue

Misc Places
- Removed expired, irrelevant, and fixed todos

FloatingHeaderPartial
- Fixed "Written" vs "Published" text logic

SettingsGeneralController
- Removed single quotes from property names

EditorBaseController, MarkerManagerMixin
- Aligned var declarations

PostItemView
- Commented out unfunctional code for feature request #2398
- Switched `isPage`, `isFeatured` to be computed properties in `Po
- use `toggleProperty` in `PostController.action.toggleFeatured`
2014-06-17 14:59:15 -06:00

28 lines
865 B
JavaScript

import ajax from 'ghost/utils/ajax';
import styleBody from 'ghost/mixins/style-body';
import AuthenticatedRoute from 'ghost/routes/authenticated';
var SignoutRoute = AuthenticatedRoute.extend(styleBody, {
classNames: ['ghost-signout'],
beforeModel: function () {
var self = this;
ajax({
url: this.get('ghostPaths').adminUrl('signout'),
type: 'POST',
headers: {
'X-CSRF-Token': this.get('csrf')
}
}).then(function () {
self.notifications.showSuccess('You were successfully signed out.');
self.transitionTo('signin');
}, function (resp) {
self.notifications.showAPIError(resp, 'There was a problem logging out, please try again.');
self.transitionTo('posts');
});
}
});
export default SignoutRoute;