Ghost/ghost/admin/routes/signout.js

20 lines
627 B
JavaScript
Raw Normal View History

import styleBody from 'ghost/mixins/style-body';
import loadingIndicator from 'ghost/mixins/loading-indicator';
var SignoutRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, styleBody, loadingIndicator, {
classNames: ['ghost-signout'],
afterModel: function (model, transition) {
if (Ember.canInvoke(transition, 'send')) {
transition.send('invalidateSession');
transition.abort();
this.transitionTo('signin');
} else {
this.send('invalidateSession');
this.transitionTo('signin');
}
}
});
export default SignoutRoute;