2014-06-01 23:30:50 +04:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
2014-06-05 07:18:23 +04:00
|
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
2014-06-01 23:30:50 +04:00
|
|
|
|
2014-07-25 17:38:13 +04:00
|
|
|
var SignoutRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, styleBody, loadingIndicator, {
|
2014-06-01 23:30:50 +04:00
|
|
|
classNames: ['ghost-signout'],
|
|
|
|
|
2014-07-30 00:49:26 +04:00
|
|
|
afterModel: function (model, transition) {
|
2014-06-30 16:58:10 +04:00
|
|
|
if (Ember.canInvoke(transition, 'send')) {
|
|
|
|
transition.send('invalidateSession');
|
2014-07-25 17:38:13 +04:00
|
|
|
transition.abort();
|
2014-06-30 16:58:10 +04:00
|
|
|
this.transitionTo('signin');
|
|
|
|
} else {
|
|
|
|
this.send('invalidateSession');
|
2014-07-30 00:49:26 +04:00
|
|
|
this.transitionTo('signin');
|
2014-06-30 16:58:10 +04:00
|
|
|
}
|
2014-06-01 23:30:50 +04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-06-13 23:35:22 +04:00
|
|
|
export default SignoutRoute;
|