2014-06-01 15:30:50 -04:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
2014-06-04 23:18:23 -04:00
|
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
2014-07-30 14:14:11 -04:00
|
|
|
import ghostPaths from 'ghost/utils/ghost-paths';
|
2014-06-01 15:30:50 -04:00
|
|
|
|
2014-07-25 15:38:13 +02:00
|
|
|
var SignoutRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, styleBody, loadingIndicator, {
|
2014-06-01 15:30:50 -04:00
|
|
|
classNames: ['ghost-signout'],
|
|
|
|
|
2014-07-29 20:49:26 +00:00
|
|
|
afterModel: function (model, transition) {
|
2014-07-30 13:32:19 +00:00
|
|
|
this.notifications.clear();
|
2014-06-30 14:58:10 +02:00
|
|
|
if (Ember.canInvoke(transition, 'send')) {
|
|
|
|
transition.send('invalidateSession');
|
2014-07-25 15:38:13 +02:00
|
|
|
transition.abort();
|
2014-07-30 14:14:11 -04:00
|
|
|
this.hardRefresh();
|
2014-06-30 14:58:10 +02:00
|
|
|
} else {
|
|
|
|
this.send('invalidateSession');
|
2014-07-30 14:14:11 -04:00
|
|
|
this.hardRefresh();
|
2014-06-30 14:58:10 +02:00
|
|
|
}
|
2014-07-30 14:14:11 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
hardRefresh: function () {
|
|
|
|
window.location = ghostPaths().adminRoot + '/signin/';
|
2014-06-01 15:30:50 -04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-06-13 13:35:22 -06:00
|
|
|
export default SignoutRoute;
|