Ghost/ghost/admin/routes/signout.js
Hannah Wolfe 820459e625 Merge pull request #3463 from rwjblue/hard-refresh
Perform a hard refresh upon signout.
2014-07-30 22:28:27 +01:00

26 lines
797 B
JavaScript

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