2014-10-28 09:29:42 -05:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
2014-06-01 14:30:50 -05:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
2014-06-04 22:18:23 -05:00
|
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
2014-06-01 14:30:50 -05:00
|
|
|
|
2014-10-28 09:29:42 -05:00
|
|
|
var SignoutRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, {
|
2014-11-25 15:56:08 -05:00
|
|
|
titleToken: 'Sign Out',
|
|
|
|
|
2014-06-01 14:30:50 -05:00
|
|
|
classNames: ['ghost-signout'],
|
|
|
|
|
2014-07-29 15:49:26 -05:00
|
|
|
afterModel: function (model, transition) {
|
2014-07-30 08:32:19 -05:00
|
|
|
this.notifications.clear();
|
2014-06-30 07:58:10 -05:00
|
|
|
if (Ember.canInvoke(transition, 'send')) {
|
|
|
|
transition.send('invalidateSession');
|
2014-07-25 08:38:13 -05:00
|
|
|
transition.abort();
|
2014-06-30 07:58:10 -05:00
|
|
|
} else {
|
|
|
|
this.send('invalidateSession');
|
|
|
|
}
|
2014-10-24 16:09:50 -05:00
|
|
|
}
|
2014-06-01 14:30:50 -05:00
|
|
|
});
|
|
|
|
|
2014-06-13 14:35:22 -05:00
|
|
|
export default SignoutRoute;
|